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&...]