DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
Embedded
...
ActiveMQ
...
Broker
...
with
...
Camel
...
running
...
in
...
Apache
...
Tomcat
...
example
...
Available
...
as
...
of
...
Camel
...
2.11
...
This
...
example
...
shows
...
how
...
you
...
can
...
embed
...
Apache
...
ActiveMQ
...
Broker
...
and
...
Camel
...
in
...
a
...
web
...
application,
...
which
...
can
...
run
...
on
...
Apache
...
Tomcat
...
or
...
other
...
web
...
containers.
...
This
...
example
...
embeds
...
ActiveMQ
...
Broker
...
and
...
a
...
Camel
...
application
...
which
...
will
...
continuously
...
send
...
a
...
message
...
per
...
second
...
to
...
an
...
inbox
...
queue.
...
Then
...
another
...
Camel
...
route
...
will
...
route
...
messages
...
from
...
the
...
inbox
...
to
...
the
...
outbox
...
queue.
...
Building
...
and
...
Running
...
example
...
You
...
will
...
need
...
to
...
build
...
this
...
example
...
first:
| Code Block |
|---|
} mvn install {code} Which will create a .war file in the target directly. You can then deploy this .war file in any web container such as Apache Tomcat, by copying the .war file to its / |
Which will create a .war file in the target directly. You can then deploy this .war file in any web container such as Apache Tomcat, by copying the .war file to its /webapp directory.
For example to start Apache Tomcat
| Code Block |
|---|
webapp directory. For example to start Apache Tomcat {code} bin/catalina.sh run {code} |
And
...
then
...
build
...
the
...
example
...
and
...
deploy
...
to
...
Apache
...
Tomcat
| Code Block |
|---|
} mvn install cp target/camel-example-activemq-tomcat.war /opt/apache-tomcat-7.0.26/webapps/ {code} h3. Source code This example is a web application which mean we have a {{web.xml}} file in the {{ |
Source code
This example is a web application which mean we have a web.xml file in the src/main/webapp/WEB-INF
...
directory.
...
The
...
code
...
is
...
as
...
follows:
| Wiki Markup |
|---|
{snippet:id=e1|lang=xml|url=camel/trunk/examples/camel-example-activemq-tomcat/src/main/webapp/WEB-INF/web.xml} |
We
...
have
...
two
...
Spring
...
XML
...
files
...
that
...
embed
...
- broker.xml
...
- to
...
- embed
...
- Apache
...
- ActiveMQ
...
- broker
...
- camel-config.xml
...
- to
...
- embed
...
- Apache
...
- Camel
...
- with
...
- the
...
- routes
...
The
...
broker.xml
...
file
...
is
...
located
...
in
...
the
...
src/main/resources
...
directory
...
and
...
contains:
| Wiki Markup |
|---|
{snippet:id=e1|lang=xml|url=camel/trunk/examples/camel-example-activemq-tomcat/src/main/resources/broker.xml} |
The
...
camel-config.xml
...
file
...
is
...
located
...
in
...
the
...
src/main/resources
...
directory
...
and
...
contains:
| Wiki Markup |
|---|
{snippet:id=e1|lang=xml|url=camel/trunk/examples/camel-example-activemq-tomcat/src/main/resources/camel-config.xml} h3. JMX You can use JConsole to get details about the running ActiveMQ. This is done by starting up jconsole, and in the remote services input box, type in {code} service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi {code} h3. See Also - Other [Examples] - Camel [ActiveMQ] component - [Apache ActiveMQ|http://activemq.apache.org/] |
JMX
You can use JConsole to get details about the running ActiveMQ and Camel. This is done by starting up jconsole, and then under local processes,
select the process which has catalina in the name (catalina is Apache Tomcat).
See Also
- Other Examples
- Camel ActiveMQ component
- Apache ActiveMQ