Before posting my query here is the configuration I am using:_
Weblogic Server 10.3.3
Soa Server 22.214.171.124.0
Oracle JDeveloper 126.96.36.199.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
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 ...
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.
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?