Author |
Message
|
FBothma01 |
Posted: Thu Aug 07, 2014 3:08 am Post subject: JMSProvider configurable service to connect to HornetQ |
|
|
Newbie
Joined: 07 Aug 2014 Posts: 2 Location: Edinburgh
|
After trying various options and searching for examples, I eventually managed to create a Configurable service that can be referenced from an IIB message flow's JMSInput and JMSOutput nodes. The requirement was to read messages from a HornetQ queue or Topic and then process them through the IIB (v9). The most difficult part was to understand and define suitable values to the Configurable Service (JMSProviders) to allow it find the target objects via JNDI.
So here are the steps.
1. The configurable service will need access to the HornetQ Client classes. Copy and store those in a location the QM has access to. I decided on storing them under "/var/mqsi/jars/hornet-2.2.14" (on Linux off course ). This will allow new services to be created if there is a HornetQ upgrade in future.
2. Ensure you have the JNDI connection details and that, when required, firewall rules have been updated to allow traffic between the MQ server and the HornetQ server. You will need to know the IP address and port number the HornetQ JNDI server is listening on.
3. Decide on which InitialContext Factory you need. I found "org.jnp.interfaces.NamingContextFactory" to work just fine.
Next create your Configurable Service based on the IBM supplied JMSProviders Template.
The following Properties are set. I am only referencing the ones that are not left to default values.
1. Name (set to the name of your Configurable service. This will referenced in your JMSInput/JMSOutput nodes (JMS Connection/JMS provider name propertyof the nodes)
2. connectionFactoryName ("ConnectionFactory")
3. initialContextFactory ("org.jnp.interfaces.NamingContextFactory")
4. jarsURL (example "/var/mqsi/jars/hornet-2.2.14" or wherever you decided to copy the HornetQ client jar files)[
5. jndiBindingsLocation (using protocol jnp "ip or dns of the JNDI server:JNDI listener port".
That's it!
Now use your Configurable service (by name) as the JMS provider name in your JMS-type nodes. You may also consider defining the Basic properties on those nodes to direct your flow to read or write to particular queues or topics. In my case the flow needs to subscribe to a HornetQ topic and receive messages from there so the following properties are defined:-
Basic/Subscription topic ("topic/HornetQTestTopic")
 |
|
Back to top |
|
 |
FBothma01 |
Posted: Thu Aug 07, 2014 3:11 am Post subject: Re: JMSProvider configurable service to connect to HornetQ |
|
|
Newbie
Joined: 07 Aug 2014 Posts: 2 Location: Edinburgh
|
After trying various options and searching for examples, I eventually managed to create a Configurable service that can be referenced from an IIB message flow's JMSInput and JMSOutput nodes. The requirement was to read messages from a HornetQ queue or Topic and then process them through the IIB (v9). The most difficult part was to understand and define suitable values to the Configurable Service (JMSProviders) to allow it find the target objects via JNDI.
So here are the steps.
1. The configurable service will need access to the HornetQ Client classes. Copy and store those in a location the QM has access to. I decided on storing them under "/var/mqsi/jars/hornet-2.2.14" (on Linux off course ). This will allow new services to be created if there is a HornetQ upgrade in future.
2. Ensure you have the JNDI connection details and that, when required, firewall rules have been updated to allow traffic between the MQ server and the HornetQ server. You will need to know the IP address and port number the HornetQ JNDI server is listening on.
3. Decide on which InitialContext Factory you need. I found "org.jnp.interfaces.NamingContextFactory" to work just fine.
Next create your Configurable Service based on the IBM supplied JMSProviders Template.
The following Properties are set. I am only referencing the ones that are not left to default values.
1. Name (set to the name of your Configurable service. This will referenced in your JMSInput/JMSOutput nodes (JMS Connection/JMS provider name propertyof the nodes)
2. connectionFactoryName ("ConnectionFactory")
3. initialContextFactory ("org.jnp.interfaces.NamingContextFactory")
4. jarsURL (example "/var/mqsi/jars/hornet-2.2.14" or wherever you decided to copy the HornetQ client jar files)[
5. jndiBindingsLocation (using protocol jnp "ip or dns of the JNDI server:JNDI listener port".
That's it!
Now use your Configurable service (by name) as the JMS provider name in your JMS-type nodes. You may also consider defining the Basic properties on those nodes to direct your flow to read or write to particular queues or topics. In my case the flow needs to subscribe to a HornetQ topic and receive messages from there so the following properties are defined:-
Basic/Subscription topic ("topic/HornetQTestTopic")
[/quote] |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Aug 07, 2014 5:11 am Post subject: Re: JMSProvider configurable service to connect to HornetQ |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
FBothma01 wrote: |
1. The configurable service will need access to the HornetQ Client classes. Copy and store those in a location the QM has access to. I decided on storing them under "/var/mqsi/jars/hornet-2.2.14" (on Linux off course ). |
My gut instinct says it's a bad idea to put stuff under /var/mqsi. At least you didn't put these jar files in .../classes...
The rest of this is spot on, and well done by you. |
|
Back to top |
|
 |
GSnyder13 |
Posted: Sat Oct 04, 2014 12:12 pm Post subject: |
|
|
Novice
Joined: 29 Mar 2005 Posts: 13 Location: United States
|
We have recently implemented broker flows that send Textmessages to HornetQ using the JMSOutput node. For the most part it works great except...when we get this:
Code: |
<usr><ExceptionList><RecoverableException><File>/build/slot1/S800_P/src/DataFlowEngine/PluginInterface/ImbJniNode.cpp</File><Line>1253</Line><Function>ImbJniNode::evaluate</Function><Type>ComIbmJMSClientOutputNode</Type><Name>RetailOps_Pack_Cost_Tomax_Reformat#FCMComposite_1_3</Name><Label>RetailOps_Pack_Cost_Tomax_Reformat.IN_QUEUE</Label><Catalog>BIPmsgs</Catalog><Severity>3</Severity><Number>2230</Number><Text>Caught exception and rethrowing</Text><Insert><Type>14</Type><Text>RetailOps_Pack_Cost_Tomax_Reformat.IN_QUEUE</Text></Insert><RecoverableException><File>JMSClientErrors.java</File><Line>695</Line><Function>JMSClientRequestResponseHelper::setupJMSRequest()</Function><Type></Type><Name></Name><Label></Label><Catalog>BIPmsgs</Catalog><Severity>1</Severity><Number>4644</Number><Text>Error creating JMS Message</Text><Insert><Type>5</Type><Text>Broker 'BRKP02'; Execution Group 'Retail'; Message Flow 'RetailOps_Pack_Cost_Tomax_Reformat'; Node 'IN_QUEUE::ComIbmJMSClientOutputNode' </Text></Insert><Insert><Type>5</Type><Text>Session is closed</Text></Insert><Insert><Type>5</Type><Text> Session is closed</Text></Insert></RecoverableException></RecoverableException></ExceptionList></usr> |
These errors seem to be happening randomly. When the backout messages are placed back on the input MQ queues, they go through with no problem. Just wondering if anyone else has experienced this problem? |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Oct 05, 2014 7:42 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Seems to come from a problem when trying to use a closed session.
Open a PMR.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|