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
Expand all | Collapse all

How to store messages on Queue

  • 1.  How to store messages on Queue

    Posted 08/29/16 08:39 AM

    Hello Experts,

    I am using UM 9.9. Could you please help me to achieve below scenario.

    I am fetching the records from DB in batches and sending to queue on UM and I want to hold all the messages in queue until the last record is fetched from DB. Once all the records are fetched then only subscriber should consume all messages.

    Regards,
    Nikhil Pardeshi


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


  • 2.  RE: How to store messages on Queue

    Posted 08/29/16 09:53 AM

    Have you considered using transaction management? Create a JMS connection with Local transaction type and keep transaction boundaries. This will help you achieve your case…!


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


  • 3.  RE: How to store messages on Queue

    Posted 08/29/16 10:17 AM

    Hello Srikanth,

    I have created the JMS connection but I am not sure how to implement transaction boundaries.


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


  • 4.  RE: How to store messages on Queue

    Posted 08/29/16 10:19 AM

    Hello Nikhil,

    This is very easy. Create JMS connection with Local Transaction type. Now use the ART services “Start, Commit, Rollback” services, just like you use them with DB adapter services…

    Regards,
    Srikanth


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


  • 5.  RE: How to store messages on Queue

    Posted 08/29/16 10:35 AM

    Fetch all the records from DB and map it to doc list and call pub.jms:sendBatch


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


  • 6.  RE: How to store messages on Queue

    Posted 08/29/16 10:57 AM

    Hello Srikanth,

    We are calling JMS over queue. JMS adapter connection is not there in our set up. I have configured JMS connection through settings->Messaging. Hence. i guess I cannot use start and commit.

    Hello Mahesh,

    Thanks, I will try to use and update the thread.


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


  • 7.  RE: How to store messages on Queue

    Posted 08/29/16 11:35 AM

    Hello Mahesh,

    I tried implementing sendBatch but it failed and in the guide it is mentioned that we can only use pub.jms:sendBatch service with the webMethods Broker.

    Any other way, you would suggest.


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


  • 8.  RE: How to store messages on Queue

    Posted 08/29/16 01:19 PM

    Nikhil,

    You really do not JMS adapter connection for this. You can use JMS connection from created from messaging along with transaction management as well.

    Use pub.jms.send service to send to the queue/topic with in the transaction boundaries. Make sure you create JMS connection of type Local Transaction.


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


  • 9.  RE: How to store messages on Queue

    Posted 08/29/16 03:52 PM

    Ah :shock:

    Then you might have to go with pub.jms:send. Handle the transaction reading and writing through ART transactions services (Local Tx… For more details refer 9-10_Using_Integration_Server_to_Build_a_Client_for_JMS


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


  • 10.  RE: How to store messages on Queue

    Posted 08/30/16 12:24 PM

    Thank you Srikanth & Mahesh, I went through the guide and it helped me alot.
    But I am facing below error while consuming the messages using pub.jms:receive

    javax.jms.IllegalStateException: Consumer already closed

    Any idea what could be the issue?

    Regards,
    Nikhil Pardeshi


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


  • 11.  RE: How to store messages on Queue

    Posted 08/30/16 12:27 PM

    Nikhil,

    why are you using pub.jms:receive? Have you considered using JMS triggers, which automatically invoke a service when a message arrives on a queue/topics.


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


  • 12.  RE: How to store messages on Queue

    Posted 08/30/16 12:51 PM

    You are rite Jonathan, actually what I am doing is

    1-> I am picking the data from DB in batches and pushing into 1 queue on UM along with that assigning unique Id to the batches.
    2-> Once all the batches I have pushed to UM then I am pushing one more message which is having only unique Id.

    And I have configured trigger for 2nd step which will extract the unique Id from the queue and pull all the messages from the 2nd queue matching the unique Ids using pub.jms:receive in that trigger service only.


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


  • 13.  RE: How to store messages on Queue

    Posted 08/30/16 02:45 PM

    Are you using the same JMS connection in both the cases?


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


  • 14.  RE: How to store messages on Queue

    Posted 08/31/16 03:42 AM

    Yes Srikanth, both queues are using same connection factory and same JMS connection.


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


  • 15.  RE: How to store messages on Queue

    Posted 08/31/16 05:54 AM


  • 16.  RE: How to store messages on Queue

    Posted 08/31/16 07:24 AM

    Below is the error:

    com.wm.lang.flow.FlowException: javax.jms.IllegalStateException: Consumer already closed


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


  • 17.  RE: How to store messages on Queue

    Posted 08/31/16 07:31 AM

    Hello Nikhil,

    Can you pass on the full error stack trace from IS admin Console > logs > error?

    Regards,
    Srikanth


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


  • 18.  RE: How to store messages on Queue

    Posted 08/31/16 10:34 AM

    Hello Srikanth,

    I am not getting any error in error trace, also I am getting this error only while debugging and when it is called by trigger service then it runs successfully. But not picking messages from the queue.


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