This discussion is archived
9 Replies Latest reply: Apr 10, 2013 4:07 AM by Saqib Riaz RSS

Consuming jms queue synchronously in SOA11g

871156 Newbie
Currently Being Moderated
Before posting my query here is the configuration I am using:_

Weblogic Server 10.3.3
Soa Server 11.1.1.3.0
Oracle JDeveloper 11.1.1.3.0

Till now I have done the following things:_

1) created a JMS queue with auto-generate Unit-of-order name property checked
2) Producing JMS Messages in the Queue with the help of an Asynchronous BPEL process.

I can see the produced message in the Queue in FMW console

What is my requirement?_

1) I want to read (consume)only one of the above created JMS Messages in the main BPEL process(Synchronous), then needs to process it
And based on my Business condition I have to write that message in the Database.
After successful completion of this instance only my main process should go to consume the next message in the queue.

What is the problem I am facing?_

1) The main BPEL process is not reading one message at a time. I.e. if there are 10 messages in the queue, then as soon as the main bpel process gets deployed, 10 instances created automatically, all in running status and Queue gets empty
2) And if I explicitly test the process, the processes always go in running mode. I.e. Waiting for the messages at the receive activity (this receive is attached to the JMS adapter through operation consume in the main BPEl process)

I just want to know how I can read the jms messages one by one, though there may be n number of messages in the queue
And only after the completion of the first instance (of Reading First JMS message from queue) it would go to initiate the next instance and so on

Would anyone please help me in this issue?
  • 1. Re: Consuming jms queue synchronously in SOA11g
    NarsingPumandla Pro
    Currently Being Moderated
    Hello friend,

    So, according to your scenario...you are producing messages into the Queue using JMS Adapter Outbound Operation ( JMS adapter is on the references side)

    And as we know, in order to read the message from JMS Queue we use JMS Adapter and that would be inbound operation (JMS adapter is on the services side)

    So, when we define a JMS adapter in our composite as consume message operation...then the JMS adapter will be on the services side...then we declare our BPEL interface based on the WSDL of JMS Adapter (Consume operation). SO by default the interface of the BPEL would be one-way i.e., just fire and forget. So, lets say you wrote 10 messages to the Queue. So, the consuming BPEL would take all messages at a time...as you said there would be 10 instances....

    So, if you make the interface of the BPEL to synchronous and also you just need to reply back ( any dummy message) to JMS adapter....just keep a reply activity at the end of the BPEL ...so by doing this...unless and until it gets the response from the synchronous BPEL (consuming BPEL), the JMS adapter doesn't give the next message in the Queue to the BPEL...that means at any point of time only one BPEL instance would be running for you which is what we want to achieve...And you can see this clearly in the Queue in the weblogic admin console...This is called throttling the JMS adapter....This works...

    And one more important thing to be considered is...taking the synchronous process time out thing...as we know by default the client of the synchronous process cannot wait for more than 45 seconds...may be if you want more time to process ...you can change that in EM console...BPEL properties in SOA administration...

    I think it is syncMaxWaitTime..change that may be to 300...

    Try this...Hopefully this should work for you..and let us know ...

    Hope this helps...

    Thanks,
    N
  • 2. Re: Consuming jms queue synchronously in SOA11g
    871156 Newbie
    Currently Being Moderated
    Hi,

    Thanks for your reply. It has helped me a lot. Now the instance are creating one at a time.

    Just one more thing to ask:

    The instance are created automatically. I want that the instance should create only upon testing the process. How it can be done.


    Thanks
  • 3. Re: Consuming jms queue synchronously in SOA11g
    871156 Newbie
    Currently Being Moderated
    Instance are created automatically. they should be created only upon initiating the main bpel process
  • 4. Re: Consuming jms queue synchronously in SOA11g
    NarsingPumandla Pro
    Currently Being Moderated
    As you are getting the data from JMS Queue, as far as i know there is not a way of getting the data from JMS whenever we want...

    The instances will be created automatically as long as the messages are there in the queue...

    Thanks,
    N
  • 5. Re: Consuming jms queue synchronously in SOA11g
    871156 Newbie
    Currently Being Moderated
    Thanks Naresh for your valuable comments, it helped me lot
  • 6. Re: Consuming jms queue synchronously in SOA11g
    871156 Newbie
    Currently Being Moderated
    Hi Naresh,

    Thankyou very much for your support in JMS Queueing issue. Now I am doing the the same thing in MQ.
    Would you please help me in this issue (MQ) for the same used case which you you have resolved in JMS case.

    Thanks
    Sunil
  • 7. Re: Consuming jms queue synchronously in SOA11g
    875289 Newbie
    Currently Being Moderated
    If you are replying to the JMS adapter, what is the port type to which you are replying to. Because when you select the Consume_Message operation, the interface generated for the adapter doesn't have a port type to which you can reply back to. I am trying to figure out what you have done exactly. Can you please explain how you are able to give the reply back from the BPEL process to the JMS adapter which uses Consume_Message operation?
  • 8. Re: Consuming jms queue synchronously in SOA11g
    Saqib Riaz Newbie
    Currently Being Moderated
    Is this possible in Oracle BPEL on 10.1.3.4?
    How should the reply variable look like?
  • 9. Re: Consuming jms queue synchronously in SOA11g
    Saqib Riaz Newbie
    Currently Being Moderated
    Is this possible in Oracle BPEL on 10.1.3.4?
    How should the reply variable look like?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points