[jboss-dev-forums] [JBoss ESB Development] - Sending a message through Scheduler

Martin Myslík do-not-reply at jboss.com
Thu May 2 05:07:14 EDT 2013


Martin Myslík [https://community.jboss.org/people/m.myslik] created the discussion

"Sending a message through Scheduler"

To view the discussion, visit: https://community.jboss.org/message/811185#811185

--------------------------------------------------------------
Hi,

I am quite new to ESB and I would like to send messages from a service through simple scheduler. I have a class that has method which sends and ESB aware message:

+public void sendMessage(String message) throws Exception+
+   {+
+      // Create the delivery adapter for the target service (cache it)+
+      System.setProperty("javax.xml.registry.ConnectionFactoryClass",+
+            "org.apache.ws.scout.registry.ConnectionFactoryImpl");+

+      // Create the delivery adapter for the target service (cache it)+
+      ServiceInvoker deliveryAdapter = new ServiceInvoker("FirstServiceESB",+
+            "SimpleListener");+


+      // Create and populate the request message...+
+      Message requestMessage = MessageFactory.getInstance().getMessage(+
+            MessageType.JBOSS_XML);+

+      requestMessage.getBody().add(message);+

+      // Deliver the request message synchronously - timeout after 20+
+      // seconds...+
+      deliveryAdapter.deliverAsync(requestMessage);+
+   }+

I found only very vague tutorials on how to implement Scheduler (I mean in jboss-esb.xml file). How do I trigger this method? Can you show me and example jboss-esb.xml configuration taht would call *sendMessage()* function multiple times?+
+
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/811185#811185]

Start a new discussion in JBoss ESB Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2032]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20130502/51610350/attachment.html 


More information about the jboss-dev-forums mailing list