3 Replies Latest reply on May 20, 2013 2:08 PM by jmiguel77

    Is there any API or service in Jboss ESB to read from the Queue

    somsathi

      Hi,

       

      Inorder to read from the Queue, we can use a JMS or MDB and read it using  Consumer. like wise , is there any similar built in class in Jboss ESB to configure it in the jboss-esb.xml.

       

      Thanks in Advance.

        • 1. Re: Is there any API or service in Jboss ESB to read from the Queue
          somsathi

          Like to be more specific,

           

          here is my requirement.

           

          I am placing a Message in the Queue using JMS Router of ESB after  many operations (attaching my Jboss-esb.xml), now to read from the queue in which i have posted using JMS Router, is it possible to configure in the Jboss-esb.xml, using a built in class(if there is) of Jboss ESB, and expose it as a webservice.

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

          <?

           

          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 http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"

           

          parameterReloadSecs="5"

          >

           

           

          <providers

          >

           

          <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"

          >

           

          <jms-bus busid="quickstartGwChannel"

          >

           

          <jms-message-filter dest-type="QUEUE" dest-name="queue/webservice_qw"

          />

           

          </jms-bus

          >

           

          <jms-bus busid="quickstartEsbChannel"

          >

           

          <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_webservice_producer_esb"

          />

           

          </jms-bus

          >

           

          </jms-provider

          >

           

           

          <jbr-provider name="JBR-Http" protocol="http" host="localhost"

          >

           

          <property name="serviceInvokerTimeout" value="2000000"

          />

           

          <jbr-bus busid="Http-1" port="8765"

          />

           

          </jbr-provider

          >

           

           

          <jbr-provider name="JBR-Socket" protocol="socket" host="localhost"

          >

           

          <property name="serviceInvokerTimeout" value="2000000"

          />

           

          <jbr-bus busid="Socket-1" port="8888"

          />

           

           

          </jbr-provider

          >

           

           

          <jms-provider name="JBM" connection-factory="ConnectionFactory"

          >

           

          <jms-bus busid="quickstartGwChannel_ejb"

          >

           

          <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_ejbprocessor_Request_gw"

          />

           

          </jms-bus

          >

           

          <jms-bus busid="quickstartEsbChannel_ejb"

          >

           

          <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_ejbprocessor_Request_esb"

          />

           

          </jms-bus

          >

           

           

          </jms-provider

          >

           

           

          </providers

          >

           

           

          <services

          >

           

           

          <service category="MyServiceCategory" name="MyWSProducerService" description="WS Frontend speaks natively to the ESB"

          >

           

           

          <listeners

          >

           

          <jms-listener name="JMS-Gateway" busidref="quickstartGwChannel" is-gateway="true"

          />

           

          <jbr-listener name="Http-Gateway" busidref="Http-1" is-gateway="true"

          />

           

          <jbr-listener name="Socket-Gateway" busidref="Socket-1" is-gateway="true"

          />

           

          <jms-listener name="JMS-ESBListener" busidref="quickstartEsbChannel"

          />

           

          </listeners

          >

           

           

          <actions

          >

           

           

           

          <action name="BeforeWSAction" class="org.jboss.soa.esb.samples.quickstart.service1.action.BeforeWSAction"

          />

           

           

          <action name="JBossWSAdapter" class="org.jboss.soa.esb.actions.soap.SOAPProcessor"

          >

           

          <property name="jbossws-context" value="Quickstart_webservice_producer_esb"

          />

           

          <property name="jbossws-endpoint" value="GoodbyeWorldWS"

          />

           

          </action

          >

           

           

          <action name="AfterWSAction" class="org.jboss.soa.esb.samples.quickstart.service1.action.AfterWSAction"

          >

           

           

          </action

          >

           

          <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>

           

          </actions

          >

           

          </service

          >

           

           

          <service category="EJBProcessor" name="SimpleService" description="Service that demonstrates calling EJBs"

          >

           

           

          <listeners

          >

           

          <jms-listener name="JMS-Gateway" busidref="quickstartGwChannel_ejb" is-gateway="true"

          />

           

          <jms-listener name="helloWorld" busidref="quickstartEsbChannel_ejb"

          />

           

          </listeners

          >

           

           

          <actions mep="OneWay"

          >

           

           

          <action name="ejbprocessoraction" class="org.jboss.soa.esb.samples.quickstart.service1.action.EJBProcessorAction"

          >

           

           

          </action

          >

           

           

          <action name="EJBTestVoid" class="org.jboss.soa.esb.actions.EJBProcessor"

          >

           

          <property name="ejb3" value="true"

          />

           

          <property name="method" value="printMessage"

          />

           

          <property name="jndi-name" value="SimpleSLSB/remote"

          />

           

          <property name="initial-context-factory" value="org.jnp.interfaces.NamingContextFactory"

          />

           

          <property name="provider-url" value="localhost:1099"

          />

           

          <property name="ejb-params"

          >

           

          <arg0 type="org.jboss.soa.esb.samples.quickstart.common.dto.SchoolDataRequest">requestData</arg0

          >

           

          </property

          >

           

          <property name="esb-out-var" value="org.jboss.soa.esb.message.defaultEntry"

          />

           

          </action

          >

           

           

          <action name="afterEjbprocessoraction" class="org.jboss.soa.esb.samples.quickstart.service1.action.AfterEJBProcessorAction"

          >

           

           

          </action

          >

           

           

          <action name="routeToReplyQueue" class="org.jboss.soa.esb.actions.routing.JMSRouter"

          >

           

          <property name="connection-factory" value="ConnectionFactory"

          />

           

          <property name="jndiName" value="queue/ejb_routeTo"

          />

           

          <property name="unwrap" value="true"

          />

           

          <property name="security-principal" value="guest"

          />

           

          <property name="security-credential" value="guest"

          />

           

           

          <property name="jndi-prefixes" value="org.xyz."

          />

           

          <property name="org.xyz.propertyName" value="propertyValue"

          />

           

           

          <property name="java.naming.someproperty" value="propertyValue"

          />

           

          </action

          >

           

           

           

           

          <!-- The next action is for Continuous Integration testing -->

           

          <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"

          />

           

           

          </actions

          >

           

          </service

          >

           

           

          </services

          >

           

          </

           

          jbossesb

          >

           

           

          • 2. Re: Is there any API or service in Jboss ESB to read from the Queue
            tcunning

            Sathya,

             

            I'm a little confused by what you are trying to do here - JMSRouter can send messages to a queue, which you can then consume using something else (MDB, etc).      If you want to send a message from one ESB service to another, there are better ways to do that (ServiceInvoker, StaticRouter, etc).

             

            --Tom

            • 3. Re: Is there any API or service in Jboss ESB to read from the Queue
              jmiguel77

              Hi

               

              I am using a JMSRouter to place a message on a queue, but in my mdb i am receiving this, in the message payload:

               

              <Envelope><Header xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"><wsa:To>invm://6e446576656c6f7065722424242424242424242424245661636174696f6e205265717565737420526573706f6e73652053657276696365/false?false#10000</wsa:To><jbossesb:type xmlns:jbossesb="http://schemas.jboss.com/ws/2007/01/jbossesb">urn:jboss/esb/epr/type/invm</jbossesb:type><jbossesb:passByValue xmlns:jbossesb="http://schemas.jboss.com/ws/2007/01/jbossesb">false</jbossesb:passByValue><wsa:MessageID>25b13d75-cd96-4f8a-aaf6-d9a9f7f6f945</wsa:MessageID></Header><Context /><Body><Content><Key>cGlJZA==</Key><Value><marshalunmarshal><plugin-type>urn:xml/marshalunmarshal/plugin/serialization</plugin-type>rO0ABXNyAA5qYXZhLmxhbmcuTG9uZzuL5JDMjyPfAgABSgAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAAAAAAEUg==</marshalunmarshal></Value></Content><Content><Key>cmVxdWVzdElk</Key><Value><marshalunmarshal><plugin-type>urn:xml/marshalunmarshal/plugin/serialization</plugin-type>rO0ABXNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAAE</marshalunmarshal></Value></Content><Content><Key>cGlWZXJzaW9u</Key><Value><marshalunmarshal><plugin-type>urn:xml/marshalunmarshal/plugin/serialization</plugin-type>rO0ABXNyABFqYXZhLmxhbmcuSW50ZWdlchLioKT3gYc4AgABSQAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAAB</marshalunmarshal></Value></Content></Body><Attachment /><Properties><Property><Key>amJvc3MuZXNiOmNhdGVnb3J5PU1lc3NhZ2VDb3VudGVyLGRlcGxveW1lbnQ9VmFjYXRpb25SZXF1ZXN0UHJveHkuZXNiLHNlcnZpY2UtY2F0ZWdvcnk9bkRldmVsb3BlcixzZXJ2aWNlLW5hbWU9VmFjYXRpb24gUmVxdWVzdCBSZXNwb25zZSBTZXJ2aWNlVGltZQ==</Key><Value>rO0ABXNyAA5qYXZhLmxhbmcuTG9uZzuL5JDMjyPfAgABSgAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAAAAAYUjw==</Value></Property></Properties></Envelope>

               

              In the documentation, it is mentioned that if i set the unwrap property of the JMRouter, to true, i could receive the deserialized info, but doing so i get an exception

               

              What can i do to read the info in the mdb ??

               

              JM