1 Reply Latest reply on Nov 24, 2010 8:47 AM by Tom Fennelly

    listener for ESBAware message+Socket communication

    Sandeep Gowda Newbie


          I am trying to use Jboss ESB as an interceptor for IP socket comunication.


         Simple message, which used to get communicated through IP socket client & server program. But now i need to do the same communication through Jboss ESB queues.


      Configured the Jboss-esb.xml as below.

      1)Using the Jbr-provider

      2)Client code placed below(i am able to get the connection properly)

      3)Listener code is placed below.


      Queues are created properly,But listener java class is not getting invoked.(so that i get the message which has been transfered from client).


      console of jboss esb server 4.9 below


      15:29:38,519 INFO  [JBoss4ESBDeployer] create esb service, Socket.esb
      15:29:38,769 INFO  [QueueService] Queue[/queue/socket_in_q] started, fullSize=200000, pageSize=2000, downCacheSize=2000
      15:32:22,518 INFO  [JBossRemotingGatewayListener] JBoss Remoting Gateway listener 'listener' started.



      <?xml version="1.0"?>
      <jbossesb parameterReloadSecs="5"
          xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.2.0.xsd http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.2.0.xsd">
              <jbr-provider host="localhost" name="JBR-Socket"
                  <jbr-bus busid="sockettest" port="6969" />
              <jms-provider connection-factory="ConnectionFactory"
                  <jms-bus busid="socketJmsProvider">
                      <jms-message-filter dest-name="queue/socket_in_q"
                          dest-type="QUEUE" />
              <service category="Socket" description="testSocket" name="socket-JMS-Service">
                      <jbr-listener busidref="sockettest" is-gateway="true"
                          name="socketGateway" />
                      <jms-listener busidref="socketJmsProvider" name="JMSEsbAware" />
                      <action class="listener.SocketListener" name="socketlistener"
                          process="process" />


      Client Code:

           public class SendMessage {


          public static void main(String args[]) throws Throwable {
              SendMessage sm = new SendMessage();


              sm.sendMessageToJBRListener("http", 8080, "sandeep gowda");




          private void sendMessageToJBRListener(String protocol, int port,
                  String message) throws Throwable {
              String locatorURI = protocol + "://localhost:" + port;
              InvokerLocator locator = new InvokerLocator(locatorURI);
                      .println("Calling JBoss Remoting Listener using locator URI: "
                              + locatorURI);


              Client remotingClient = null;
              try {
                  remotingClient = new Client(locator);


                  // Deliver the message to the listener...
                  Object response = remotingClient.invoke(message);
                  System.out.println("JBR Class: " + response.getClass().getName());
                  System.out.println("Response from JBoss Remoting Listener '"
                          + locatorURI + "' was '" + response + "'.");
              } finally {
                  if (remotingClient != null) {


      Listener code:


      public class SocketListener extends AbstractActionPipelineProcessor{
          protected ConfigTree _config;


          public SocketListener(ConfigTree config) {
              _config = config;
          public Message process(Message arg0) throws ActionProcessingException {


              return arg0;