<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Publishing or Consuming a Message to/from Queue in Talend in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Publishing-or-Consuming-a-Message-to-from-Queue-in-Talend/m-p/2302339#M74336</link>
    <description>I would advice you to consume and produce messages to HornetQ using the camel components in the studio instead of from within a Talend job directly. HornetQ is not OSGI compliant; you will run into connectivity issues when doing so from within A Talend job. 
&lt;BR /&gt;1. I would advice you to create a seperate HornetQ connection faction for your connecting from the ESB as shown below: 
&lt;BR /&gt; &amp;lt;connection-factory name="NettyXAConnectionFactoryESB"&amp;gt; 
&lt;BR /&gt; &amp;lt;xa&amp;gt;true&amp;lt;/xa&amp;gt; 
&lt;BR /&gt; &amp;lt;connectors&amp;gt; 
&lt;BR /&gt; &amp;lt;connector-ref connector-name="netty-connector"/&amp;gt; 
&lt;BR /&gt; &amp;lt;/connectors&amp;gt; 
&lt;BR /&gt; &amp;lt;discovery-group-ref discovery-group-name="dg-abs_91"/&amp;gt; 
&lt;BR /&gt; &amp;lt;entries&amp;gt; 
&lt;BR /&gt; &amp;lt;entry name="/XAConnectionFactoryESB"/&amp;gt; 
&lt;BR /&gt; &amp;lt;/entries&amp;gt; 
&lt;BR /&gt; &amp;lt;consumer-window-size&amp;gt;0&amp;lt;/consumer-window-size&amp;gt; 
&lt;BR /&gt; &amp;lt;connection-load-balancing-policy-class-name&amp;gt; 
&lt;BR /&gt; org.hornetq.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy 
&lt;BR /&gt; &amp;lt;/connection-load-balancing-policy-class-name&amp;gt; 
&lt;BR /&gt; &amp;lt;/connection-factory&amp;gt; 
&lt;BR /&gt; 
&lt;BR /&gt;2. Create a cJMSConnectionFactory in the mediation perspective and add the jars to the dependency lib: 
&lt;BR /&gt;- jnp-client.jar 
&lt;BR /&gt;- hornetq-client-core.jar 
&lt;BR /&gt;- hornetq-client-jms.jar 
&lt;BR /&gt;-netty.jar 
&lt;BR /&gt; 
&lt;BR /&gt;3. Use connection factory custom code as shown below: 
&lt;BR /&gt;// Set environment for this context 
&lt;BR /&gt;String cf = "/XAConnectionFactoryESB"; 
&lt;BR /&gt;String url = "jnp://ebankhost:1099"; 
&lt;BR /&gt;String id = "myBrokerName"; 
&lt;BR /&gt; 
&lt;BR /&gt;// Obtain logger 
&lt;BR /&gt;org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(this.getClass()); 
&lt;BR /&gt; 
&lt;BR /&gt;// Set naming properties 
&lt;BR /&gt;java.util.Hashtable&amp;lt;String, String&amp;gt; env = new java.util.Hashtable&amp;lt;String, String&amp;gt;(); 
&lt;BR /&gt;env.put(javax.naming.Context.PROVIDER_URL, url); 
&lt;BR /&gt;env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); 
&lt;BR /&gt;env.put(javax.naming.Context.URL_PKG_PREFIXES, "org.jboss.naming 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MA5A.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/143082iB236712184B767DA/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MA5A.png" alt="0683p000009MA5A.png" /&gt;&lt;/span&gt;rg.jnp.interfaces"); 
&lt;BR /&gt; 
&lt;BR /&gt;// Get connectionfactory from JNP endpoint(s) 
&lt;BR /&gt;javax.naming.Context ctx; 
&lt;BR /&gt;jmsConnectionFactory = null; 
&lt;BR /&gt; 
&lt;BR /&gt;// Loop until succesful connection 
&lt;BR /&gt;while (jmsConnectionFactory == null) { 
&lt;BR /&gt; // Try to get a connection forever... 
&lt;BR /&gt; try { 
&lt;BR /&gt; ctx = new javax.naming.InitialContext(env); 
&lt;BR /&gt; logger.debug("Retrieving for " + 
&lt;BR /&gt; " the connectionfactory " + cf + " from JNP endpoint(s) " + url); 
&lt;BR /&gt; 
&lt;BR /&gt; jmsConnectionFactory = (javax.jms.ConnectionFactory) ctx.lookup(cf); 
&lt;BR /&gt; logger.info("Connected successfully to " + id + " broker"); 
&lt;BR /&gt; 
&lt;BR /&gt; } catch (javax.naming.NamingException e) { 
&lt;BR /&gt; logger.warn("Cannot obtain " + id + " connectionfactory (" + 
&lt;BR /&gt; cf + ") from endpoint " + url + " due to (" + e.getMessage() + "), retrying every 5000 milliseconds..."); 
&lt;BR /&gt; try { 
&lt;BR /&gt; Thread.sleep(5000); 
&lt;BR /&gt; } catch (InterruptedException e1) { 
&lt;BR /&gt; logger.error("WTF!!! Interupted?!?", e1); 
&lt;BR /&gt; } 
&lt;BR /&gt; } 
&lt;BR /&gt;} 
&lt;BR /&gt; 
&lt;BR /&gt;4. Now point your cJms component to your cJMSConnectionFactory and voila. 
&lt;BR /&gt;All the best, 
&lt;BR /&gt;Robin</description>
    <pubDate>Sat, 27 Apr 2013 08:00:50 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-04-27T08:00:50Z</dc:date>
    <item>
      <title>Publishing or Consuming a Message to/from Queue in Talend</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Publishing-or-Consuming-a-Message-to-from-Queue-in-Talend/m-p/2302338#M74335</link>
      <description>Hi, 
&lt;BR /&gt;I need to publish a message to JBOSS 7 HornetQ and consume the same message from JBOSS 7 HornetQ.I'm using Talend Studio 5.0.2. 
&lt;BR /&gt;Does tMom component helps in it? 
&lt;BR /&gt;Please suggest me to do in JBOSS 7 Queue. 
&lt;BR /&gt;Thanks 
&lt;BR /&gt;krishna</description>
      <pubDate>Sat, 16 Nov 2024 12:02:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Publishing-or-Consuming-a-Message-to-from-Queue-in-Talend/m-p/2302338#M74335</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Publishing or Consuming a Message to/from Queue in Talend</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Publishing-or-Consuming-a-Message-to-from-Queue-in-Talend/m-p/2302339#M74336</link>
      <description>I would advice you to consume and produce messages to HornetQ using the camel components in the studio instead of from within a Talend job directly. HornetQ is not OSGI compliant; you will run into connectivity issues when doing so from within A Talend job. 
&lt;BR /&gt;1. I would advice you to create a seperate HornetQ connection faction for your connecting from the ESB as shown below: 
&lt;BR /&gt; &amp;lt;connection-factory name="NettyXAConnectionFactoryESB"&amp;gt; 
&lt;BR /&gt; &amp;lt;xa&amp;gt;true&amp;lt;/xa&amp;gt; 
&lt;BR /&gt; &amp;lt;connectors&amp;gt; 
&lt;BR /&gt; &amp;lt;connector-ref connector-name="netty-connector"/&amp;gt; 
&lt;BR /&gt; &amp;lt;/connectors&amp;gt; 
&lt;BR /&gt; &amp;lt;discovery-group-ref discovery-group-name="dg-abs_91"/&amp;gt; 
&lt;BR /&gt; &amp;lt;entries&amp;gt; 
&lt;BR /&gt; &amp;lt;entry name="/XAConnectionFactoryESB"/&amp;gt; 
&lt;BR /&gt; &amp;lt;/entries&amp;gt; 
&lt;BR /&gt; &amp;lt;consumer-window-size&amp;gt;0&amp;lt;/consumer-window-size&amp;gt; 
&lt;BR /&gt; &amp;lt;connection-load-balancing-policy-class-name&amp;gt; 
&lt;BR /&gt; org.hornetq.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy 
&lt;BR /&gt; &amp;lt;/connection-load-balancing-policy-class-name&amp;gt; 
&lt;BR /&gt; &amp;lt;/connection-factory&amp;gt; 
&lt;BR /&gt; 
&lt;BR /&gt;2. Create a cJMSConnectionFactory in the mediation perspective and add the jars to the dependency lib: 
&lt;BR /&gt;- jnp-client.jar 
&lt;BR /&gt;- hornetq-client-core.jar 
&lt;BR /&gt;- hornetq-client-jms.jar 
&lt;BR /&gt;-netty.jar 
&lt;BR /&gt; 
&lt;BR /&gt;3. Use connection factory custom code as shown below: 
&lt;BR /&gt;// Set environment for this context 
&lt;BR /&gt;String cf = "/XAConnectionFactoryESB"; 
&lt;BR /&gt;String url = "jnp://ebankhost:1099"; 
&lt;BR /&gt;String id = "myBrokerName"; 
&lt;BR /&gt; 
&lt;BR /&gt;// Obtain logger 
&lt;BR /&gt;org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(this.getClass()); 
&lt;BR /&gt; 
&lt;BR /&gt;// Set naming properties 
&lt;BR /&gt;java.util.Hashtable&amp;lt;String, String&amp;gt; env = new java.util.Hashtable&amp;lt;String, String&amp;gt;(); 
&lt;BR /&gt;env.put(javax.naming.Context.PROVIDER_URL, url); 
&lt;BR /&gt;env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); 
&lt;BR /&gt;env.put(javax.naming.Context.URL_PKG_PREFIXES, "org.jboss.naming 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MA5A.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/143082iB236712184B767DA/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MA5A.png" alt="0683p000009MA5A.png" /&gt;&lt;/span&gt;rg.jnp.interfaces"); 
&lt;BR /&gt; 
&lt;BR /&gt;// Get connectionfactory from JNP endpoint(s) 
&lt;BR /&gt;javax.naming.Context ctx; 
&lt;BR /&gt;jmsConnectionFactory = null; 
&lt;BR /&gt; 
&lt;BR /&gt;// Loop until succesful connection 
&lt;BR /&gt;while (jmsConnectionFactory == null) { 
&lt;BR /&gt; // Try to get a connection forever... 
&lt;BR /&gt; try { 
&lt;BR /&gt; ctx = new javax.naming.InitialContext(env); 
&lt;BR /&gt; logger.debug("Retrieving for " + 
&lt;BR /&gt; " the connectionfactory " + cf + " from JNP endpoint(s) " + url); 
&lt;BR /&gt; 
&lt;BR /&gt; jmsConnectionFactory = (javax.jms.ConnectionFactory) ctx.lookup(cf); 
&lt;BR /&gt; logger.info("Connected successfully to " + id + " broker"); 
&lt;BR /&gt; 
&lt;BR /&gt; } catch (javax.naming.NamingException e) { 
&lt;BR /&gt; logger.warn("Cannot obtain " + id + " connectionfactory (" + 
&lt;BR /&gt; cf + ") from endpoint " + url + " due to (" + e.getMessage() + "), retrying every 5000 milliseconds..."); 
&lt;BR /&gt; try { 
&lt;BR /&gt; Thread.sleep(5000); 
&lt;BR /&gt; } catch (InterruptedException e1) { 
&lt;BR /&gt; logger.error("WTF!!! Interupted?!?", e1); 
&lt;BR /&gt; } 
&lt;BR /&gt; } 
&lt;BR /&gt;} 
&lt;BR /&gt; 
&lt;BR /&gt;4. Now point your cJms component to your cJMSConnectionFactory and voila. 
&lt;BR /&gt;All the best, 
&lt;BR /&gt;Robin</description>
      <pubDate>Sat, 27 Apr 2013 08:00:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Publishing-or-Consuming-a-Message-to-from-Queue-in-Talend/m-p/2302339#M74336</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-27T08:00:50Z</dc:date>
    </item>
  </channel>
</rss>

