IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  Java class to Subscribe a nirvana channel

    Posted 05/02/16 12:52 AM

    hi all,

    I want to create a java class as a subscriber to a nirvana’s queue .
    I’ve been trying to make it and I am on it.
    But I am afraid that Nirvana’s team already created and I missed it.

    Is there any suggestion or information about this?

    Thank you for your help.


    #Universal-Messaging-Broker
    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: Java class to Subscribe a nirvana channel

    Posted 05/02/16 05:07 AM

    I doubt if nirvana team gives an out of box java subscriber. But As you are already on it, it is quite easy to write one on your own. You can use javax.jms.* API and it should be few lines of code.


    #webMethods
    #Integration-Server-and-ESB
    #Universal-Messaging-Broker


  • 3.  RE: Java class to Subscribe a nirvana channel

    Posted 05/02/16 06:27 AM

    Hi Prasad,

    I tried to execute this code :

      Properties initialContextProperties = new Properties();
    initialContextProperties.put("java.naming.factory.initial",
    "com.pcbsys.nirvana.nSpace.NirvanaContextFactory");
    String connectionString = "nsp://myIp:9000/";
    initialContextProperties.put("connectionfactory.qpidConnectionfactory", connectionString);
    
    try {
    InitialContext initialContext = new InitialContext(initialContextProperties);
    QueueConnectionFactory queueConnectionFactory
    = (QueueConnectionFactory) initialContext.lookup("UMConnFactorySD");
    
    QueueConnection queueConnection = queueConnectionFactory.createQueueConnection();
    queueConnection.start();
    
    QueueSession queueSession = queueConnection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
    
    // Send message
    Queue queue = queueSession.createQueue("testQueue;{create:always, node:{durable: true}}");
    QueueSender queueSender = queueSession.createSender(queue);
    
    for(int count =0; count<2; count++)
    {
    queueSender.send(queueSession.createObjectMessage(new Integer(count)));
    }
    
    // Housekeeping
    queueSender.close();
    queueSession.close();
    queueConnection.stop();
    queueConnection.close();

    But still catched by jmsexception like below

    I tried that url and send message via ESB document, it’s running well.

    am I missing something for creating that contextfactory ?

    Thank you


    #webMethods
    #Universal-Messaging-Broker
    #Integration-Server-and-ESB


  • 4.  RE: Java class to Subscribe a nirvana channel

    Posted 05/02/16 06:40 AM

    You have to include the nirvana client libraries (nJMS.jar and nClient.jar) as part of your java project where you are writing your subscriber.

    You can find these jars under “/common/lib” directory.

    All nirvana related libraries start with “n” like below:

    “C:\SoftwareAG\common\lib\nJMS.jar”
    “C:\SoftwareAG\common\lib\nClient.jar”

    As per my experience, just nJMS and nClient jars should be enough to run your subscriber. But in case your program is still complaining after placing these two jars try adding other nirvana libraries too and see the behavior.


    #webMethods
    #Integration-Server-and-ESB
    #Universal-Messaging-Broker


  • 5.  RE: Java class to Subscribe a nirvana channel

    Posted 05/10/16 12:32 AM

    Hi Prasad,

    I found that there are some java code in universalmessaging/java/examples/com/pcbsys/nirvana/apps
    and I use Qpublish.java for my case.
    Thank you for your help Prasad.

    cheers,


    #webMethods
    #Universal-Messaging-Broker
    #Integration-Server-and-ESB


  • 6.  RE: Java class to Subscribe a nirvana channel

    Posted 07/11/16 03:35 PM

    Hi All,

    Sorry for hi-jacking this thread.
    I was not able to create new one.

    I’m not able to subscribe to queue. I didn’t find enough documentation online.
    I have attached the configuration file, Java MDB code & error log file.

    I’m trying to resolve this past 4 weeks. Your help will be much appreciated.

    Thanks,
    Madhvi Desai
    Error_Logs.txt (4.47 KB)
    FetchMessages.java (1.97 KB)
    standalone.xml (19.5 KB)


    #Integration-Server-and-ESB
    #Universal-Messaging-Broker
    #webMethods