Can't send JMS messages to gateway
viniciuscarvalho Dec 21, 2007 10:23 AMHello there! I've setup an ESB deployment where we receive messages through SOAP and JMS. The soap adapter is working fine. But when I try to send jms messages to my gateway queue, It takes over 2 minutes and the message is never sent. I need to cancel the unit test and then I get an error from the jboss messaging stack. Here's my config files:
jboss-esb (I've removed a few services...)
<?xml version="1.0" encoding="UTF-8"?> <jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd jbossesb-1.0.1.xsd "> <providers> <jms-provider name="jmsProvider" connection-factory="ConnectionFactory" jndi-context-factory="org.jnp.interfaces.NamingContextFactory" jndi-URL="localhost"> <jms-bus busid="Gateway"> <jms-message-filter dest-type="QUEUE" dest-name="queue/InboundQueue"/> </jms-bus> <jms-bus busid="ESBChannel"> <jms-message-filter dest-type="QUEUE" dest-name="queue/ESBChannel"/> </jms-bus> </jms-provider> <jbr-provider name="JBR-Http" protocol="http" host="localhost"> <jbr-bus busid="Http-1" port="8865" /> </jbr-provider> <jbr-provider name="JBR-Socket" protocol="socket" host="localhost"> <jbr-bus busid="Socket-1" port="8788" /> </jbr-provider> </providers> <services> <service name="InboudService" description="Servico de entrada" category="InboundServices"> <listeners> <jms-listener name="inboundListener" busidref="Gateway" is-gateway="true" maxThreads="1"/> <jms-listener name="JMS-ESB-Listener" busidref="ESBChannel" is-gateway="false" maxThreads="1"> </jms-listener> <jbr-listener name="Http-Gateway" busidref="Http-1" is-gateway="true" maxThreads="1"/> <jbr-listener name="Socket-Gateway" busidref="Socket-1" is-gateway="true" maxThreads="1"/> </listeners> <actions> <action name="print-before" class="org.jboss.soa.esb.actions.SystemPrintln"> <property name="message" value="[Quickstart_webservice_producer] BEFORE invoking jbossws endpoint"/> </action> <action name="JBossWSAdapter" class="org.jboss.soa.esb.actions.soap.SOAPProcessor"> <property name="jbossws-endpoint" value="MyService"/> </action> <action name="CallEJB" class="com.acme.actions.EjbCallerAction" process="callEJB"></action> <action name="ContentBasedRouter" class="org.jboss.soa.esb.actions.ContentBasedRouter"> <property name="ruleSet" value="contentRouter.drl"/> <property name="ruleLanguage" value="XPathLanguage.dsl"/> <property name="ruleReload" value="true"/> <property name="destinations"> <route-to destination-name="CadastroCliente" service-category="Cliente" service-name="ClienteService"/> <route-to destination-name="RemocaoCliente" service-category="Cliente" service-name="ClienteService"/> </property> <property name="object-paths"> <object-path esb="body.BODY_CONTENT"/> </property> </action> </actions> </service> </services> </jbossesb>
my junit test code:
private static ConnectionFactory cf; private static Queue targetQueue; @BeforeClass public static void setup(){ try { InitialContext ctx = new InitialContext(); cf = (ConnectionFactory) ctx.lookup("ConnectionFactory"); targetQueue = (Queue)ctx.lookup("queue/CSMInboundQueue"); } catch (NamingException e) { e.printStackTrace(); } } @Test public void testReservaIP() throws Exception{ Connection conn = null; try{ conn = cf.createConnection(); Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); conn.start(); MessageProducer producer = session.createProducer(targetQueue); TextMessage message = session.createTextMessage(); message.setText(loadText("payload.xml"); producer.send(message); producer.close(); }catch (Exception e) { }finally{ conn.stop(); conn.close(); } }
Well, it get stuck on the send part, and the ESB does not get the message at all. Am I missing something here?
Best regards