Tuesday, 1 November 2011

Sonic MQ 8.0 with Websphere Integration Developer 6.2


SonicMQ, is a Java Message Standard (JMS) - based messaging server. JMS provides a common set of interfaces, messaging concepts, and programming strategies, and makes it easy to write business applications that asynchronously send and receive critical business data and events.

Steps to Connect Sonic MQ with WID :

1. Place the Required jar files into lib\ext of WID62 :
 Get the Following Jar files from Sonic MQ lib Directory and Place them into following folder " IBM\WID62\runtimes\bi_v62\lib\ext ".
              * jndi.jar
              * mfcontext.jar
              * sonic_Client.jar
              * sonic_Crypto.jar
              * sonic_XA.jar
              * broker.jar
              * sonic_mgmt_client.jar

2. Create Topic in Sonic MQ :
            Name : SONIC_SAMPLE
3.  Create LookUp Name for the Topic in JMS Administered Objects in Sonic MQ :


Lookup Name is the Topic Alias name to which it is specified and we need to create JNDI for this Lookup name in ed in Admin Console of WAS.
Destination Name is the Topic Name in the Sonic MQ.
Normally we create JNDI for the Queue or Topic for the Websphere MQ but when we work with Third Party MQ Providers like Sonic MQ  we need to Create JNDI for the Alias name of the Topic which is specified in the JMS Administered Objects.

4. Creating Connection Factory Names and specifications :




Create a Connection Factory as mentioned below
Lookup Name : " Sonic_ConnectionFactory"
Factory Type : " TopicConnectionFactory"
Connection URL : " tcp://localhost:2506"
Default Username : " Administrator"
Password : "Administrator"

5. Create JMS Provider in Admin Console of WAS.



 Name of the JMS Provider : " Sonic MQ Provider "
Class Path of the jar files : " path of the jar files where we placed "
: " com.sonicsw.jndi.mfcontext.MFContextFactory "
: " tcp://localhost:2506 " ( Give host name where the sonic mq is installed ).

6. Create JNDI for TopicConnection Factory in Admin Console :



Name : "Sonic_ConnectionFactory"
Type : Topic
JNDI Name : " jms/Sonic_ConnectionFactory"
External JNDI Name : "Sonic_ConnectionFactoryb"
Component Managed Authentication Alias : Give some name which contains :  username / password ( Administrator/Administrator )

7. Create JNDI for Topic in Admin Console :
Here we need to create JNDI for Topic which is already created in Sonic MQ. Here we need to observe that we should create JNDI for Topic Look up name of specified Topic i.e to this " SONIC_SAMPLE_LOOKUP " we need to create JNDI.


7. Specify the Bindings of Import and Export in the Assembly Diagram :
7.1 Import :
Now Take an Import into Assembly Diagram. and Give an Interface to it.
then Specify Binding as " GenericJMSBinding ". Specify JMS messaging domain " Publish-Subscribe",  and Provide JNDI names for Both Topic Connection Factory and Topic.




7.2 Export :
Now take a Export in Assembly Diagram.and Give an Interface to it.then Specify Binding as " GenericJMSBinding ". Specify JMS messaging domain " Publish-Subscribe",  and Provide JNDI names for Both Topic Connection Factory and Topic. In additional that we need to specify the Listener Port. and this listener Port also to be created by us.  


9.The Import in the Assembly Diagram as shown below.



10.Creating Listener Port for Export :

Open Admin Console -> Application Servers -> server1->Message Listener Service ->  Listener Ports. and then Create Listener port specified in the Export in Assembly diagram with the Appropriate JNDI Names of Topic Connection Factory and Topic.



Now save all the changes and Deploy it into Websphere Process Server. To Test this flow Right Click on Import and choose Test Component. then Run the Flow.

The Result of this flow is the data goes to the Sonic MQ when we run the flow  and the Through the Export the flow will get the same data From Sonic MQ and It prints in the Java Component.

Thank You.

4 comments:

  1. Hi, I followed the above steps and while testing I see the javax.naming.AuthenticationException error as stacktrace below :
    Pls let me know if I am missing anything.

    Thanks,
    with regards,
    Srinivas


    [2/19/14 18:08:42:046 EST] 0000000d FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\qesb\logs\ffdc\server1_4d964d96_14.02.19_18.08.42.04567016475031688087.txt com.ibm.ejs.jms.listener.MDBListenerImpl.internalStart 281
    [2/19/14 18:08:42:046 EST] 0000000d MDBListenerIm W WMSG0019E: Unable to start MDB Listener _export.ZSonicMQtoMQTopicExportGENJMS, JMSDestination jms/SMQ_TEST_TOPIC_LOOKUP : com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. [Root exception is javax.naming.AuthenticationException: Failed to connect to the management broker due to authentication failure; connection state=1]

    ReplyDelete
    Replies
    1. Hi Srinivas,
      Have you created Component-Managed Authenticated Alias name ( J2c Authentication and Alias name ) in Security tab of WAS Admin Console.

      Lets take above example, i created one J2c Authentication and Alias name as "widnode/sonic_auth" which contains Username and password ( Administrator/Administrator ) of Sonic MQ. This entry should be there in Component-Managed Authenticated Alias name because with these values only WID will communicate with Sonic MQ. try it once.

      Delete
  2. Hi,
    We are trying to post/read message from SonicMQ JMS queue. Can you please point to relevant links which can help in this? We are using WESB 8.0.1.2. I have tried above steps by creating queue, qcf instead of topic, but it is not able to post message.

    ReplyDelete
  3. Where are the pictures? I need the pics.

    ReplyDelete