You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by tbenke <ta...@LHsystems.com> on 2013/03/11 09:31:09 UTC

Camel/Spring integration between JBoss MQ-s

Hello Everybody!
I have worked for a while on a Camel route, between some JBoss MQ-s and
other (file, Karaf log) endpoints.
I use Apache ServiceMix 4.4.2 (with Camel 2.8.5 and Spring 3.0.6.RELEASE
inside), and JBoss [EAP] 5.1.1, under Microsoft Windows 7 Professional
64-bit SP1.

I had to shift (with +300) the port set of JBoss to avoid interference with
ServiceMix and Oracle 11g database, so that I run JBoss with this command:
	run.bat -Djboss.service.binding.set=ports-03
I have created two JBoss queue-s by means of the admin console of JBoss,
with JNDI names queue/Test1
and queue/Test2.

I collected a set of JBoss dependency JARs, and OSGi-fied them with the BND
tool:
	concurrent.jar
	javassist.jar
	jboss-aop-client.jar
	jboss-client.jar
	jboss-common-core.jar
	jboss-ha-client.jar
	jboss-ha-legacy-client.jar
	jboss-javaee.jar
	jboss-logging-spi.jar
	jboss-mdr.jar
	jboss-messaging-client.jar
	jboss-remoting.jar
	jboss-security-spi.jar
	jboss-serialization.jar
	jmx-invoker-adaptor-client.jar
	jnp-client.jar
	trove.jar

I have used some other JARs as well, but I think, they didn't make any
difference:
	jbossmq.jar
	jbossall-client.jar
	jbossmq-client.jar
	jboss-jmx.jar

I have used this Spring camel-context.xml (containing 3 route definitions):


The first (File >> JBoss MQ) and second (Timer >> JBoss MQ) routes are
working properly, if I drop the
above mentioned dependencies and the camel-context.xml to ServiceMix's
/deploy folder.

The third (JBoss MQ >> Karaf log) route does not process messages, despite
the consumer appears on the Test1 JBoss queue, and the bundle/route status
is Active/Started.

The automatic OSGi headers of the deployed camel-context.xml are:


The imports of this camel-context.xml artifact are:


Of course, there are no exports.

I made a complete OSGi bundle JAR from the mentioned camel-context.xml, with
the following 

The org.jboss.mq package was missing, so I deployed jboss/jbossmq_3.2.3.jar
(downloaded and bundlefied from a local Maven repository).
The bundle was immediately started, and the behavior of the routes was
exactly the same as I mentioned above.

It looks wery cool and simple to write down, but in reality, I spent
approximately 2.5 months with it, 
and after all, I still don't have a Camel/Spring config to consume from a
JBoss MQ!

I have read a number of resources (including official JBoss/Camel
documentation); for example:
http://www.jboss.org/jbossas/docs
https://issues.jboss.org/browse/JBBOOT-138
http://www.coderanch.com/t/90486/JBoss/Failed-load-users-passwords-role
http://docs.jboss.org/jbossas/getting_started/v5/html/tour.html#d0e569
http://docs.jboss.org/jbossas/jboss4guide/r4/html/ch6.chapt.html
http://www.mastertheboss.com/jboss-jms/jboss-jms-queue-example
http://stackoverflow.com/questions/2478729/jboss-messaging-jms
http://onjava.com/pub/a/onjava/2006/02/22/asynchronous-messaging-with-spring-jms.html?page=1
http://forum.springsource.org/showthread.php?17491-Failed-to-convert-SpyConnectionFactory-to-ConnectionFactory
http://integrationsphere.blogspot.hu/2011/07/camel-and-hornetq-as-jms-provider.html
http://integrationsphere.blogspot.hu/2011/07/camel-and-hornetq-as-jms-provider.html
http://java.dzone.com/articles/camel-and-hornetq-jms-provider
http://www.theserverside.com/discussions/thread.tss?thread_id=9653
https://community.jboss.org/thread/29768
http://stackoverflow.com/questions/5256060/ejb-exception-while-try-to-run-the-client
http://docs.jboss.org/jbossmessaging/docs/userguide-1.4.2.GA/html/installation.html
http://mavenhub.com/c/org/jnp/interfaces/namingcontextfactory/dependency
https://community.jboss.org/thread/154570
https://community.jboss.org/message/207352#207352
https://community.jboss.org/thread/175935
https://community.jboss.org/thread/162575
http://www.javamonamour.org/2011/03/me-jms-hermesjms-and-jboss.html
http://forum.springsource.org/showthread.php?59005-JNDI-connection-factory-config
http://www.stevideter.com/2008/08/25/simplifying-spring%E2%80%99s-jms-configuration-for-jnditemplate/
http://www.mydeveloperconnection.com/html/Spring-JNDI-Datasource..htm
http://forum.springsource.org/showthread.php?60768-Configuring-Initial-Context
http://forum.springsource.org/archive/index.php/t-124901.html
http://java.dzone.com/articles/bridging-between-jms-and
http://mail-archives.apache.org/mod_mbox/camel-users/201111.mbox/%3C1322215472697-5022416.post@n5.nabble.com%3E
http://72.2.112.194/tag/spring
http://static.springsource.org/spring/docs/3.0.0.M3/reference/html/ch23s04.html
http://www.mentby.com/Group/apache-camel/jms-transaction-in-jboss-camel-is-not-work.html
http://www.torsten-horn.de/techdocs/jee-jndi.htm
http://karaf.922171.n3.nabble.com/Paxexam-karaf-startup-issue-td3914766.html
http://karaf.922171.n3.nabble.com/Paxexam-karaf-startup-issue-td3916549.html
http://www.castor.org/spring-orm-integration.html
http://forum.springsource.org/showthread.php?120990-Error-on-using-Jndi-Template-for-Spring-Integration-amp-MQ-connection
http://fusesource.com/docs/esb/3.5/jms/ESBJMSConnectFactoryJNDI.html
http://forum.springsource.org/showthread.php?58223-Using-JNDI-to-configure-a-JndiTemplate
https://community.jboss.org/thread/152456
http://grokbase.com/t/servicemix/users/068yn1azmv/jndi-and-jbossmq
http://docs.oracle.com/javase/jndi/tutorial/TOC.html
http://activemq.2283324.n4.nabble.com/Route-messages-from-HornetQ-to-ActiveMQ-td4435172.html
http://stackoverflow.com/questions/1974883/jboss-4-2-2-to-5-0-1-migrationneeded-jboss-client-jar-files
http://docs.jboss.org/jbossremoting/2.5.4.SP2/userguide/html_single/
http://docs.jboss.org/jbossremoting/2.5.3.SP1/html/
http://stackoverflow.com/questions/8561622/jboss-as-7-simple-hello-world-application
https://community.jboss.org/message/613171
http://www.mastertheboss.com/jboss-configuration/the-jndiproperty-pitfall
http://www.mastertheboss.com/jboss-configuration/jboss-port-configuration
http://www.mastertheboss.com/jboss-jms
http://www.mastertheboss.com/jboss-jms/jboss-jms-configuration/page-2
http://www.mastertheboss.com/jboss-jms/jboss-jms-queue-example
https://issues.jboss.org/secure/attachmentzip/unzip/12400214/12330767%5B63%5D/jts-exampleJZ/src/com/arjuna/ats/tools/TxTestJR.java
http://www.mastertheboss.com/jboss-jms/jboss-jms-configuration/page-2
http://www.mastertheboss.com/jboss-jms/jboss-jms-queue-example
http://stackoverflow.com/questions/11471679/spring-configure-the-datasource-through-jndi-having-remote-jboss-server
http://fusesource.com/forums/thread.jspa?messageID=7828
https://community.jboss.org/message/439509#439509
http://docs.jboss.org/jbossmessaging/docs/userguide-1.4.0.SP3/html/installation.html#install.extra-steps
http://www.tutorials.de/enterprise-java-jee-j2ee-spring-co/355197-invalidmarshallingresource-can-not-find-valid-marshaller-data-type-jms.html
http://integrationsphere.blogspot.hu/2011/07/camel-and-hornetq-as-jms-provider.html
https://community.jboss.org/thread/128897
https://community.jboss.org/thread/1468
http://camel.apache.org/maven/current/camel-jms/apidocs/org/apache/camel/component/jms/JmsComponent.html
[JBoss JMS Component Javadoc]
http://docs.jboss.org/jbossas/jboss4guide/r4/html/ch3.chapter.html
http://www.coderanch.com/t/459111/java/java/security-manager-rmi-class-loader
https://community.jboss.org/message/197278
http://www.tutorials.de/enterprise-java-jee-j2ee-spring-co/355197-invalidmarshallingresource-can-not-find-valid-marshaller-data-type-jms.html
http://s139.codeinspot.com/q/878267
http://forum.springsource.org/showthread.php?90417-Using-JMS-Namespace-Support-to-configure-JBoss
http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/jms.html

I had many weird errors as well (later debugged), but I still cannot make my
Camel route to consume from JBoss.

I have written three POJO's to send and receive from/to JBoss, as well.

*First is Sender.java:*


*Second is SerialReceiver.java*, which can consume only 1 message per run:


*Third is ContinuousReceiver.java*, which will receive all messages from the
queue while running:

I have tried to embed these POJO-s, as Processor beans, into Camel routes,
with no success.
I was not able to run them in ServiceMix.
(They were originally running in Eclipse, so I bundlefied and deployed tose
JBoss JARs, which were imported automatically by the IDE.)

It is rather funny to me, that only a number of forum topics deal with such
a cardinal question: how to make Camel routes between
JBoss MQ-s, and something else. JBoss MQ-s are widely used...

Also, if there is a handful of topics on it, they do not conclude to
anything, or they state some wrong,
stupid solutions, that doesn't work.

So I kindly ask, if there is a single man/woman on the Internet, who can
solve this problem IN REALITY,
please tell the EXACT solution to me.

I am especially interested in:
	- the exact Camel/Spring config,
	- the JAr's Import-Package statements,
	- and the dependency JARs GAV values.

[Perhaps my JBoss is not configured properly (I don't think so), or I missed
some beans from the camel-context.xml...]

With best regards:
Tamás Benke
Junior Java developer, IOCC team

Lufthansa Systems Hungária Kft.
BUD LSYH - Airline Management Solutions
INFOPARK, Building E
Neumann János u. 1./E.
H-1117 Budapest
Hungary

E-mail: tamas.benke.U522971@LHsystems.com
www.LHsystems.com




--
View this message in context: http://servicemix.396122.n5.nabble.com/Camel-Spring-integration-between-JBoss-MQ-s-tp5716081.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Camel/Spring integration between JBoss MQ-s

Posted by Freeman Fang <fr...@gmail.com>.
Just for a better track, this issue also discussed on camel mailing list[1]
[1]http://camel.465427.n5.nabble.com/Camel-Routing-between-JBoss-MQ-s-td5728923.html
-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

On 2013-3-11, at 下午4:31, tbenke wrote:

> Hello Everybody!
> I have worked for a while on a Camel route, between some JBoss MQ-s and
> other (file, Karaf log) endpoints.
> I use Apache ServiceMix 4.4.2 (with Camel 2.8.5 and Spring 3.0.6.RELEASE
> inside), and JBoss [EAP] 5.1.1, under Microsoft Windows 7 Professional
> 64-bit SP1.
> 
> I had to shift (with +300) the port set of JBoss to avoid interference with
> ServiceMix and Oracle 11g database, so that I run JBoss with this command:
> 	run.bat -Djboss.service.binding.set=ports-03
> I have created two JBoss queue-s by means of the admin console of JBoss,
> with JNDI names queue/Test1
> and queue/Test2.
> 
> I collected a set of JBoss dependency JARs, and OSGi-fied them with the BND
> tool:
> 	concurrent.jar
> 	javassist.jar
> 	jboss-aop-client.jar
> 	jboss-client.jar
> 	jboss-common-core.jar
> 	jboss-ha-client.jar
> 	jboss-ha-legacy-client.jar
> 	jboss-javaee.jar
> 	jboss-logging-spi.jar
> 	jboss-mdr.jar
> 	jboss-messaging-client.jar
> 	jboss-remoting.jar
> 	jboss-security-spi.jar
> 	jboss-serialization.jar
> 	jmx-invoker-adaptor-client.jar
> 	jnp-client.jar
> 	trove.jar
> 
> I have used some other JARs as well, but I think, they didn't make any
> difference:
> 	jbossmq.jar
> 	jbossall-client.jar
> 	jbossmq-client.jar
> 	jboss-jmx.jar
> 
> I have used this Spring camel-context.xml (containing 3 route definitions):
> 
> 
> The first (File >> JBoss MQ) and second (Timer >> JBoss MQ) routes are
> working properly, if I drop the
> above mentioned dependencies and the camel-context.xml to ServiceMix's
> /deploy folder.
> 
> The third (JBoss MQ >> Karaf log) route does not process messages, despite
> the consumer appears on the Test1 JBoss queue, and the bundle/route status
> is Active/Started.
> 
> The automatic OSGi headers of the deployed camel-context.xml are:
> 
> 
> The imports of this camel-context.xml artifact are:
> 
> 
> Of course, there are no exports.
> 
> I made a complete OSGi bundle JAR from the mentioned camel-context.xml, with
> the following 
> 
> The org.jboss.mq package was missing, so I deployed jboss/jbossmq_3.2.3.jar
> (downloaded and bundlefied from a local Maven repository).
> The bundle was immediately started, and the behavior of the routes was
> exactly the same as I mentioned above.
> 
> It looks wery cool and simple to write down, but in reality, I spent
> approximately 2.5 months with it, 
> and after all, I still don't have a Camel/Spring config to consume from a
> JBoss MQ!
> 
> I have read a number of resources (including official JBoss/Camel
> documentation); for example:
> http://www.jboss.org/jbossas/docs
> https://issues.jboss.org/browse/JBBOOT-138
> http://www.coderanch.com/t/90486/JBoss/Failed-load-users-passwords-role
> http://docs.jboss.org/jbossas/getting_started/v5/html/tour.html#d0e569
> http://docs.jboss.org/jbossas/jboss4guide/r4/html/ch6.chapt.html
> http://www.mastertheboss.com/jboss-jms/jboss-jms-queue-example
> http://stackoverflow.com/questions/2478729/jboss-messaging-jms
> http://onjava.com/pub/a/onjava/2006/02/22/asynchronous-messaging-with-spring-jms.html?page=1
> http://forum.springsource.org/showthread.php?17491-Failed-to-convert-SpyConnectionFactory-to-ConnectionFactory
> http://integrationsphere.blogspot.hu/2011/07/camel-and-hornetq-as-jms-provider.html
> http://integrationsphere.blogspot.hu/2011/07/camel-and-hornetq-as-jms-provider.html
> http://java.dzone.com/articles/camel-and-hornetq-jms-provider
> http://www.theserverside.com/discussions/thread.tss?thread_id=9653
> https://community.jboss.org/thread/29768
> http://stackoverflow.com/questions/5256060/ejb-exception-while-try-to-run-the-client
> http://docs.jboss.org/jbossmessaging/docs/userguide-1.4.2.GA/html/installation.html
> http://mavenhub.com/c/org/jnp/interfaces/namingcontextfactory/dependency
> https://community.jboss.org/thread/154570
> https://community.jboss.org/message/207352#207352
> https://community.jboss.org/thread/175935
> https://community.jboss.org/thread/162575
> http://www.javamonamour.org/2011/03/me-jms-hermesjms-and-jboss.html
> http://forum.springsource.org/showthread.php?59005-JNDI-connection-factory-config
> http://www.stevideter.com/2008/08/25/simplifying-spring%E2%80%99s-jms-configuration-for-jnditemplate/
> http://www.mydeveloperconnection.com/html/Spring-JNDI-Datasource..htm
> http://forum.springsource.org/showthread.php?60768-Configuring-Initial-Context
> http://forum.springsource.org/archive/index.php/t-124901.html
> http://java.dzone.com/articles/bridging-between-jms-and
> http://mail-archives.apache.org/mod_mbox/camel-users/201111.mbox/%3C1322215472697-5022416.post@n5.nabble.com%3E
> http://72.2.112.194/tag/spring
> http://static.springsource.org/spring/docs/3.0.0.M3/reference/html/ch23s04.html
> http://www.mentby.com/Group/apache-camel/jms-transaction-in-jboss-camel-is-not-work.html
> http://www.torsten-horn.de/techdocs/jee-jndi.htm
> http://karaf.922171.n3.nabble.com/Paxexam-karaf-startup-issue-td3914766.html
> http://karaf.922171.n3.nabble.com/Paxexam-karaf-startup-issue-td3916549.html
> http://www.castor.org/spring-orm-integration.html
> http://forum.springsource.org/showthread.php?120990-Error-on-using-Jndi-Template-for-Spring-Integration-amp-MQ-connection
> http://fusesource.com/docs/esb/3.5/jms/ESBJMSConnectFactoryJNDI.html
> http://forum.springsource.org/showthread.php?58223-Using-JNDI-to-configure-a-JndiTemplate
> https://community.jboss.org/thread/152456
> http://grokbase.com/t/servicemix/users/068yn1azmv/jndi-and-jbossmq
> http://docs.oracle.com/javase/jndi/tutorial/TOC.html
> http://activemq.2283324.n4.nabble.com/Route-messages-from-HornetQ-to-ActiveMQ-td4435172.html
> http://stackoverflow.com/questions/1974883/jboss-4-2-2-to-5-0-1-migrationneeded-jboss-client-jar-files
> http://docs.jboss.org/jbossremoting/2.5.4.SP2/userguide/html_single/
> http://docs.jboss.org/jbossremoting/2.5.3.SP1/html/
> http://stackoverflow.com/questions/8561622/jboss-as-7-simple-hello-world-application
> https://community.jboss.org/message/613171
> http://www.mastertheboss.com/jboss-configuration/the-jndiproperty-pitfall
> http://www.mastertheboss.com/jboss-configuration/jboss-port-configuration
> http://www.mastertheboss.com/jboss-jms
> http://www.mastertheboss.com/jboss-jms/jboss-jms-configuration/page-2
> http://www.mastertheboss.com/jboss-jms/jboss-jms-queue-example
> https://issues.jboss.org/secure/attachmentzip/unzip/12400214/12330767%5B63%5D/jts-exampleJZ/src/com/arjuna/ats/tools/TxTestJR.java
> http://www.mastertheboss.com/jboss-jms/jboss-jms-configuration/page-2
> http://www.mastertheboss.com/jboss-jms/jboss-jms-queue-example
> http://stackoverflow.com/questions/11471679/spring-configure-the-datasource-through-jndi-having-remote-jboss-server
> http://fusesource.com/forums/thread.jspa?messageID=7828
> https://community.jboss.org/message/439509#439509
> http://docs.jboss.org/jbossmessaging/docs/userguide-1.4.0.SP3/html/installation.html#install.extra-steps
> http://www.tutorials.de/enterprise-java-jee-j2ee-spring-co/355197-invalidmarshallingresource-can-not-find-valid-marshaller-data-type-jms.html
> http://integrationsphere.blogspot.hu/2011/07/camel-and-hornetq-as-jms-provider.html
> https://community.jboss.org/thread/128897
> https://community.jboss.org/thread/1468
> http://camel.apache.org/maven/current/camel-jms/apidocs/org/apache/camel/component/jms/JmsComponent.html
> [JBoss JMS Component Javadoc]
> http://docs.jboss.org/jbossas/jboss4guide/r4/html/ch3.chapter.html
> http://www.coderanch.com/t/459111/java/java/security-manager-rmi-class-loader
> https://community.jboss.org/message/197278
> http://www.tutorials.de/enterprise-java-jee-j2ee-spring-co/355197-invalidmarshallingresource-can-not-find-valid-marshaller-data-type-jms.html
> http://s139.codeinspot.com/q/878267
> http://forum.springsource.org/showthread.php?90417-Using-JMS-Namespace-Support-to-configure-JBoss
> http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/jms.html
> 
> I had many weird errors as well (later debugged), but I still cannot make my
> Camel route to consume from JBoss.
> 
> I have written three POJO's to send and receive from/to JBoss, as well.
> 
> *First is Sender.java:*
> 
> 
> *Second is SerialReceiver.java*, which can consume only 1 message per run:
> 
> 
> *Third is ContinuousReceiver.java*, which will receive all messages from the
> queue while running:
> 
> I have tried to embed these POJO-s, as Processor beans, into Camel routes,
> with no success.
> I was not able to run them in ServiceMix.
> (They were originally running in Eclipse, so I bundlefied and deployed tose
> JBoss JARs, which were imported automatically by the IDE.)
> 
> It is rather funny to me, that only a number of forum topics deal with such
> a cardinal question: how to make Camel routes between
> JBoss MQ-s, and something else. JBoss MQ-s are widely used...
> 
> Also, if there is a handful of topics on it, they do not conclude to
> anything, or they state some wrong,
> stupid solutions, that doesn't work.
> 
> So I kindly ask, if there is a single man/woman on the Internet, who can
> solve this problem IN REALITY,
> please tell the EXACT solution to me.
> 
> I am especially interested in:
> 	- the exact Camel/Spring config,
> 	- the JAr's Import-Package statements,
> 	- and the dependency JARs GAV values.
> 
> [Perhaps my JBoss is not configured properly (I don't think so), or I missed
> some beans from the camel-context.xml...]
> 
> With best regards:
> Tamás Benke
> Junior Java developer, IOCC team
> 
> Lufthansa Systems Hungária Kft.
> BUD LSYH - Airline Management Solutions
> INFOPARK, Building E
> Neumann János u. 1./E.
> H-1117 Budapest
> Hungary
> 
> E-mail: tamas.benke.U522971@LHsystems.com
> www.LHsystems.com
> 
> 
> 
> 
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/Camel-Spring-integration-between-JBoss-MQ-s-tp5716081.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.