publish a JMS message to UM through Java

Hi ,
I want to publish a JMS message (a document) to UM using java code, can anyone help me on this. Thanks!

please check examples which gets installed with UM.

or look at UM api documentation available.

Thanks Mangat, Can you provide me any link to of UM api.

http://um.terracotta.org/#page/%2Fum.terracotta.org%2Funiversal-messaging-webhelp%2Fco-index_dg_17.html%23

if you are not able to open this above link then go to
um.terracotta.org and look for developer guide.

Hi Abhishek,

You can use below java code for Publishing JMS messages

public void JmsMessagePub() throws Exception
{
String RNAME={“nsp://127.0.0.1:9000”};
nSessionAttributes nsa=new nSessionAttributes(RNAME);

                    myReconnectHandler rhandler=new myReconnectHandler(); 
                    nSession mySession=nSessionFactory.create(nsa, rhandler); 
                    mySession.init(); 


                     nChannelAttributes chaAtt = new nChannelAttributes(); 
                     chaAtt.setName("/docs/msgdocumentType"); 
                     nChannel myChannel=mySession.findChannel(chaAtt); 
                     System.out.println("Channel has been created.."); 

                         //Constructing an Event

                      nEventProperties props = new nEventProperties(); 

                       props.put("bondname", "bond1");
                       props.put("price", 100.00);
                       nConsumeEvent evt = new nConsumeEvent( "atag", props );
                       myChannel.publish(evt); 

      }

if you are required more information please let me know.

Thanks
Ashish Kumar

Above mentioned example works perfectly but keep in mind that properties set (props) will be reflected in the properties section under JMSMessage. If you want to publish some document or data structure that has to be reflected as message under “body” then convert that same to bytes and use nConsumeEvent (String tag, byte[] data)

Thanks so much for the information. Our organization is looking to publish an event to a TOPIC or Queue from SSIS server. What jar’s do we need them to provide from UM for them to communicate with UM in order for them to publish an event.

JMSClient jar is necessary for UM API devlopment.

For using UM API you will need the below jars located in the directory “/common/lib”

nClient.jar, nJMS.jar, nAdminAPI.jar

Refer to the below URL for the API documentation,

http://um.terracotta.org/universal-messaging-webhelp/Doc/java/index.html

Regards
Abir

If you are using pure JMS pub/sub, you do not need nAdminAPI.jar. You only need nJMS.jar and nClient.jar.