Pages

Sunday, February 27, 2011

Building an asynchronous web service with OSB

A few weeks ago I made a blogpost over how you can build an asynchronous web service with JAX-WS. In this blogpost I will do the same in the Oracle Service Bus. What you probably already know is that OSB Proxy Service does not support asynchronous calls. This does not mean that it is impossible to do asynchronous calls in the OSB.  To make this work I have the following setup.
A HTTP Proxy Service  -> JMS Business Service -> Queue -> JMS Proxy Service -> HTTP Business Service.

I start with the WSDL which has two operations execute and callback.
The execute operation is used in the HTTP Proxy Service and the callback operation in the HTTP Business Service. The HTTP Proxy Service does the following:
  • retrieves the Addressing MessageID from the header, $header/wsa05:MessageID/text() , In this case you need to use the 2005 / 08 addressing.
  • retrieves the Addressing Reply URL from the header, $header/wsa05:ReplyTo/wsa05:Address/text(). This URL will be used in the callback HTTP Business Service
  • Make a new Body for the Queue which contains the WS Request and the Reply URL
  • Set the JMS CorrelationID with MessageID as value, use the Transport Header activity
  • Call the JMS Business Service.   
The JMS Business Service put the Message on a Queue.

The JMS Queue has the following exception properties, these settings are very important else you can create a loop when something goes wrong, with these settings the message will be moved to the error queue when the dequeue proxy service fails twice.
The JMS Dequeue Proxy Service steps:

  • Dequeue the JMS Message
  • Retrieves the Addressing MessageID from the JMS header, $inbound/ctx:transport/ctx:request/tp:headers/jms:JMSCorrelationID/text()
  • Retrieves the ReplyURL from the body
  • Replace the header with this one <wsa05:RelatesTo>{$messageId}</wsa05:RelatesTo>
  • Set the URL with the ReplyURL value, set the URL in the Routing Options activity.
  • Call the HTTP Business Service.
The HTTP Business Service has a dummy url and uses the callback operation from the WSDL.

Deploy everything to the OSB Server and start SOAPUI so you can test this OSB project.

In SOAPUI you can import the WSDL of the HTTP Proxy Service. I will use the execute operation as test and  make a mock service based on the callback operation.
Start the mockservice and remember the url of this mock service
Create a request and enable WS-Adressing, put the mockservice url in the Reply To field and enable Randomly generate MessageId
The OSB will call your mock service with the response and uses RelatesTo element which contains the MessageId of the request.

Here you got the OSB export of my test project.

66 comments:

  1. Hi Edwin,
    Have a question for you... slightly related to this blog but not fully...so excuse me for the same...I have a situation where the SOA Composite can only be initiated thr JMS...is it possible to modify the inbound JMS adapter with request-reply options for inbound service from the clinet. I know it works fine as a "reference" but I need the same for inbound service. If it is not possible, is there any way I can access the header properties of the JMS message from the inbound JMS adapter...that way say if I could access the JMSReplyTo property...I can send a msg back accordingly.Any help in this regard is greatly appreciated.We are using Oracle SOA 11g (11.1.1.3) vesion

    ReplyDelete
  2. Hi,

    I think Inboud request / reply jms works with OSB Proxy but not with a SOA Composite. here you can use it as reference. but you can use a inboud and outbound jms adapter in a soa composite and set the correlationId

    yes you can retrieve and set all the jms adapters properties.

    thanks

    ReplyDelete
  3. Hi Edwing,

    Hope you can help me. I have a bpel syncrhonous service and i want to publish it in the OSB as a one way service. I've allready modified the wsdl exposed by OSB and it does not return a reply, but it still waits for the call to the bpel service to end. So, is there no other way but to make the bpel synchronous service one way or asynchronous?

    I hope i've made my self clear. Thanks in advance

    Víctor

    ReplyDelete
  4. Ok,

    your use case is that you don't want to wait for the bpel to finish and I think you don't care about the response of the bpel.

    By the way did you use a publish action in the request pipeline pair of the OSB.

    and can't you change the bpel so it directly gives you a response and continue after this or make it a fire and forget BPEL.

    thanks

    ReplyDelete
  5. Hi Edwin,
    Thanks for the nice article.I have one regarding the Queue.In this article ENQueue.biz and DEQueue.proxy in both service using one queue i.e QueueAsync.I am also tried like this but when I test the ENQueue.biz I got the mesaage in QueueAsync queue and then when I test DEQueue.proxy Nothing found in Queue.Can you please give any suggestion and directions how to Dequeue from JMS Enqueue.

    Thanks
    Mani

    ReplyDelete
  6. Hi Edwin,Thanks for nice article.I follow this,but when I test callback.biz I got error.CallBack.biz is to deplyed in SOA composite? and then impoting it in to OSB?As I am right?Can you give any suggestions.

    ReplyDelete
  7. Hi Edwin,
    Thanks for this nice post. I am trying to use the similar approach of using a Foreign JMS server along with a Datasource to have a Proxy Service on OSB pick up JMS messages from AQ. The difference is I an not using the JMS Adapter of SOASuite .. but using the JMS transport protocol in OSB to communicate with the Foreign JMS server. Wanted to know if you have tried this approach with OSB proxy service? If yes, any input for that would be real helpful.
    Thanks in advance.

    Regards,
    Brajesh

    ReplyDelete
  8. Hi,

    it should work , I made a blog about this ( foreign server ) and also used this in a MDB so it should work in the same JVM ( else you will get serialization excpetions ).

    do it in the same jvm as the foreign server and use the right jndi names. / can be replace with . and no need to configure a resource adapter.

    so for CF you can use the local default ones and provide the queue name.

    thanks

    ReplyDelete
  9. Hi Edwin,

    I have a BPEL process 'A' that invokes an asynchronous BPEL process 'B' by call back mechanism. So, the BPEL process 'A' have invoke and call back activities. However, when there any fault occuring in process 'B', the BPEL process 'A' is still in waiting/receive mode. Actually, my requirement is to get the error from process 'B' and based on it, I would like to use fault framework for human intervention so that I can resubmit the request to 'B'. Could you please let me know if it is possible for human intervention through Fault Frame Work (fault policy and fault binding)in case of Asynchronous processing. I read in a site that, only faults occured in invoke activity can be handled using fault framework. Could you please clarify this for me.

    ReplyDelete
  10. Hi,

    you can try to retry the adapter the failed adapter in bpel and use human intervention, then you can retry in the EM.
    or you can to intercept the whole request van B and publish it to a queue with a java class in the fault framework. A other proces can read this and make a human task. This human task can try to re-publish it again.

    Read the AIA document , this contains an error hospital.

    good luck

    ReplyDelete
  11. Thanks Edwin.
    Please help me with little more clarification:
    In the above case, when I get response back from BPEL 'B', based on the response message, I need to pass control to fault frame work,where I can decide to either terminate or to invoke process 'B' again. But looks like the fault framework is associated only to invoke activity. Since my call to 'B' is async, I cant get to FaultFrameWork. My question is how to pass control to fault framework using a throw activity? Is it possible at all? Should I put a dummy failed invoke activity to just pass control to Fault FrameWork? Please help me with this.

    ReplyDelete
  12. Hi,

    Ok you don't have an adapter failure but just an error ,
    you can throw any adapter , bpel error from bpel this will always go the fault framework and depends of your composite fault configuration what happens.

    but you can make a java one and decide to do next.

    thanks

    ReplyDelete
  13. Hello Edwin, I have a related question, and I hope u can put me on the right track.


    I need to bridge a synchronous client call to a asynchronous business server.
    The OSB manual briefly mentions it is possible in 2 lines:

    "In sync-async bridging, a synchronous client issues a request to an asynchronous provider. For this pattern, Oracle Service Bus provides the capability to publish a message on one JMS queue and configure a second JMS queue for the response, with a timeout value for
    listening for the response. This type of service appears as a synchronous service to the service consumer."

    But I have no clue how to do it. And I dont find any additional information.

    Regards,
    Alex

    ReplyDelete
  14. Hi,

    you can create a business service with messaging service transport type.

    in transport tab use jms and provide the queue url and in jms transport tab set the response queues, response pattern and the response uri for the response queue where the response will be enqueued.

    hope this helps.

    ReplyDelete
  15. Hi Edwin, very nice blog. Congrats.

    I'd like your sugestion about Asynchronous WS on OSB.
    I have a Legacy System that reads a message from a JMS Queue and replies it to another queue, based on JMSReplyTo Message Property.
    I would like to wrap it in a Async WS, but I have faced an issue.

    In details, I'd like to have:
    HTTP Proxy Service -> JMS Business Service -> Queue A -> Legacy System -> Queue B (based on ReplyTo) -> JMS Proxy Service -> HTTP Business Service.

    The issue is how to set the Message Property JMSReplyTo to "Queue B" without set the JMS Business Service to syncronous?

    Is there another aprouche for this situation? since the Legacy System has a slow process.

    Thanks in advance.
    Danilo Ribeiro

    ReplyDelete
    Replies
    1. Hi,

      You can use the transport activity and set this header property . That should work.

      Thanks Edwin.

      Delete
    2. I tried it before but it seems that the Transport Header Action has no JMSReplyTo, and when I try to set it as "other" I receive an error:

      [JMSClientExceptions:055121]Invalid property name, "JMSReplyTo".

      I presume this property cannot be a String. It must be a Queue Destination.

      Have you already tried it?

      Delete
    3. Hi,

      In OEPE this is no problem. Do you have this error on deployment

      <con1:transport-headers>
      <con2:id>_ActionId-713</con2:id>
      <con1:header-set>outbound-request</con1:header-set>
      <con1:header name="JMSReplyTo" value="expression">
      <con2:xqueryText>'1223'</con2:xqueryText>
      </con1:header>
      </con1:transport-headers>

      Delete
    4. In fact, it's a runtime error:

      System Error Handler

      $fault:
      <con:fault xmlns:con="http://www.bea.com/wli/sb/context">
      <con:errorCode>BEA-380002</con:errorCode>
      <con:reason>
      [JMSClientExceptions:055121]Invalid property name, "JMSReplyTo"
      </con:reason>
      </con:fault>

      Is there any alternative?

      Delete
    5. Hi,

      I think it is a Restricted property on Which the jms transport reacts on. Can you set the response uri

      Delete
    6. Hi Edwin,

      I see, the problem setting the response uri is that the business service (thread) will wait for reply, and the process can be long.
      I'm thinking in write a WebService which forward the message to the queues.
      What do you think? Do you think is there another approach?

      Delete
  16. Hi Edwin,
    Can this service be invoked from a BPEL Service?

    ReplyDelete
    Replies
    1. Hi,

      No problem, it should work perfectly.

      thanks

      Delete
  17. Hi Edwin,
    I have SOA Suite Composite service receiving messages using one-way returns faults communication pattern. It works fine. However, introducing OSB to abstract this service creates issues with this pattern and the client no longer seems to receive the faults back. How do I workaround this.

    This mediator pattern does not work with OSB. Refer 23.1.1 for details of the mediator pattern. Please suggest.

    Thanks
    Thomas

    ReplyDelete
    Replies
    1. Hi,

      First can you add an error stage on the routenode and log the response. If you get the error you can always send the error. But I think you get a http 200 and then OSB thinks it went ok .

      One way is async and OSB does not supports this out of the box. You must know the client callback url, you can set a new callback url to a other proxy and soa can invoke that other proxy and you can send back the error to the original callback url.

      thanks

      Delete
  18. Hi Edwin,

    Good article. Can you please help with one scenario. I would like to invoke Async OSB service from BPEL and in BPEL after the call I don't want to wait for the response from OSB.

    I have created the Async WSDL for OSB and was able to invoke the OSB execute operation from BPEL. Added few other operations in OSB. Now, after the call, BPEL is waiting for the OSB to finish its work. What should I do to make it work and not to wait for OSB to respond.

    Thanks
    Sandeep.

    ReplyDelete
  19. Adding few more detials:

    As I don't have use of response message from OSB so I don't want to implement the JMS queue method.

    Here is the process flow:

    BPEL1-->OSB1 (Response not sent to BPEL1) --> OSB2
    (Dont wait for response from OSB1)
    |
    |
    Call Other BPEL2 immediately after the OSB1 call

    Thanks
    Sandeep.

    ReplyDelete
  20. Hi Edwin,

    This article helped me to understand the async process in OSB.

    I tried this example but I am getting null value for replyUrl in Request.proxy ($header/wsa05:ReplyTo/wsa05:Address/text())

    I logged the $replyUrl.. [RouteNode1, null, null, REQUEST]

    Do you I have to set any property?

    Can you please help me with this issue.

    ReplyDelete
    Replies
    1. Hi,

      Can you log the request or use a HTTP analyzer to see the soap header. Maybe it has a different namespace or adressing is not there

      Thanks

      Delete
  21. This article is helpful, thank you. I distilled this article in http://soa-java.blogspot.nl/2012/01/asynchronous-web-service-using-oracle.html

    ReplyDelete
  22. Hi Edwin,
    Thanks for ur post.
    Can u post an article for the scenario of picking Message from a JMS IQ and post it to an Oracle DB after validating the message in the proxy service.

    Regards,
    VeeKey

    ReplyDelete
  23. Hi Edwin,
    Thanks for ur post.
    Can u post an article for the scenario of picking Message from a JMS IQ and post it to an Oracle DB after validating the message in the proxy service.

    Regards,
    VeeKey

    ReplyDelete
  24. Hi Edwin,
    I have a similar case where I set the Transport Header in PS and this value when used in SOA JMS Message Selector, it is not able to pick the message.
    PS (WSDL based route to BS which writes to JMS Topic and Set TH for Outbound Request in routing e.g. TicketSource = 'XYZ') --> BS (Writes mesg to Topic) --> SOA JMS consumer (jca ). JMS does not pick the message with this message selector. Please help if I have missed any step. I have done pass all headers in pipeline and get all headers in BS.

    I see in osb log $inbound

    .


    .

    .




    text/xml

    0



    Regards,
    Ravi

    ReplyDelete
    Replies
    1. Hi,

      I can't see your output, but can you see the message on the queue in the weblogic console and should not have a transacted state? plus does it contain the TicketSource header property.
      on the soa side you can use this as message selector TicketSource = 'XYZ'
      or maybe enable all headers on the Transport Header.

      Thanks

      Delete
  25. Edwin,
    I am pasting it again, when I log $inbound, it does set
    tran:user-header name="TicketSource" value="XYZ"

    When I set the message selector in jms consumer in my soa
    property name="MessageSelector" value="TicketSource='XYZ'"
    SOA composite does not pick the message.
    log $inbound from osb logs, replaced < with ### and > with &&&, so the document shows up on post
    ###con:endpoint name="ProxyService$XYZ$Services$Proxy Services$SRTicketAsync_PS" xmlns:con="http://www.bea.com/wli/sb/context"&&&
    ###con:service&&&
    ###con:operation&&&TicketCreateAsync###/con:operation&&&
    ###/con:service&&&
    ###con:transport&&&
    ###con:uri&&&/xyz/XYZInbound###/con:uri&&&
    ###con:mode&&&request###/con:mode&&&
    ###con:qualityOfService&&&best-effort###/con:qualityOfService&&&
    ###con:request ... "&&&
    ###tran:headers xsi:type="http:HttpRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports"&&&
    ###tran:user-header name="ECID-Context" value="bbb"
    ...
    ###http:Accept-Encoding&&&gzip,deflate###/http:Accept-Encoding&&&
    ###http:Connection&&&Keep-Alive###/http:Connection&&&
    ###http:Content-Length&&&15397###/http:Content-Length&&&
    ###http:Content-Type&&&text/xml;charset=UTF-8###/http:Content-Type&&&
    ###http:Host&&&osb.xyz.com:80###/http:Host&&&
    ###http:SOAPAction&&&"http://xxx.xyz.com/schema/XYZ/TicketCreateAsync"###/http:SOAPAction&&&
    ###http:User-Agent&&&Apache-HttpClient/4.1.1 (java 1.5)###/http:User-Agent&&&
    ###/tran:headers&&&
    ###tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports"&&&UTF-8###/tran:encoding&&&
    ###http:client-host&&&10.1.1.999###/http:client-host&&&
    ###http:client-address&&&10.1.1.999###/http:client-address&&&
    ###http:http-method&&&POST###/http:http-method&&&
    ###/con:request&&&
    ###con:response xsi:type="http:HttpResponseMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&&&
    ###tran:headers xsi:type="http:HttpResponseHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports"&&&
    ###tran:user-header name="TicketSource" value="XYZ"/&&&
    ###http:Content-Type&&&text/xml###/http:Content-Type&&&
    ###/tran:headers&&&
    ###tran:response-code xmlns:tran="http://www.bea.com/wli/sb/transports"&&&0###/tran:response-code&&&
    ###/con:response&&&
    ###/con:transport&&&
    ###con:security&&&
    ###con:transportClient&&&
    ###con:username&&&<anonymous&&&###/con:username&&&
    ###/con:transportClient&&&
    ###/con:security&&&
    ###/con:endpoint&&&

    Thanks

    ReplyDelete
  26. Edwin,
    I my process Proxy sets Transport header and then routes to Business service.

    Here is the code in Proxy to set Transport Header
    Set Transport Headers for[ Inbound Response ]
    Pass all Headers through Pipeline
    Transport Headers
    Name Action
    TicketSource Set Header to [ 'XYZ' ]

    In my jms Business service, I don't see any property to pass all headers.

    Please let me know is that the reason the headers don't get passed?

    Thanks,
    Ravi

    ReplyDelete
  27. Edwin,

    Instead I tried my Proxy to set Transport Header for outbound request to set one of jms properties to use, the proxy throws fault
    code: BEA-380002
    reason: [JMSClientExceptions:055121]Invalid property name, "Content-Length"
    Please let me know how I can set TH for for outbound request so as to use in Message Selector.
    Thanks,
    Ravi

    ReplyDelete
  28. Edwin,
    This step is exactly as in your book pg 88 of cookbook setting up transport header for outbound request in proxy service routing to Business service which writes to JMS topic. It raises fault when invoked:

    con:fault xmlns:con="http://www.bea.com/wli/sb/context"
    con:errorCode>BEA-380002/con:errorCode
    con:reason>[JMSClientExceptions:055121]Invalid property name, "Content-Length"/con:reason
    con:location
    con:node>RouteNode_CreateToJMS/con:node
    con:path>request-pipeline/con:path
    /con:location
    /con:fault

    ReplyDelete
    Replies
    1. Hi,

      Can you de-select pass on all header cause your proxy is a soap service and these headers are passed on to JMS.

      And when you remove the message selector on the soa jms adapter.

      Plus can you check it with the QBrowser tool http://sourceforge.net/projects/qbrowserv2/ , test the message selector , put some new messages in the queue and also try to delete them.

      and the jms message should not have a transacted state status.

      Thanks

      Delete
  29. Hi Edwin,

    I have a question on how OSB handles asynchronous communication. In BPEL we have a dehydration store where the state of the process is stored and process can be continued from last dehydration point in case of failure. As OSB does not have any dehydration store, how does it handles similar scenarios.

    Thanks

    ReplyDelete
    Replies
    1. Hi,

      you can't, one way proxy for the request and an other one way proxy for the callback. You also need to remember the callback url. Store the request in a database and activate it when you got the response.

      Thanks

      Delete
  30. Hi Edwin,
    Can you enlighten me on how to create a WCF client to consume OSB asynchronous web service? The protocol is https, soap11 with ws-addressing, and the replyto address for the callback has to be specified not anonymous. I could not find any wcf bindings including custom binding to work with OSB async web service so I created a wcf client that just sends the request while I have a separate wcf service to handle the callback reponse from the OSB. The wcf client works fine but my wcf service could not process the callback response. So what's the right way to write WCF web service client to consume async OSB web service? Any help would be greatly appreciated.

    Thanks.

    Sam

    ReplyDelete
    Replies
    1. Hi,

      OSB does not support Async out of the box. You need to create two flows , a proxy ( get the callback url and persist it somewhere ) , call the BS, another proxy reads this request,set the callback url and call the BS which deliver the response back

      Thanks

      Delete
  31. Hi Edwin,

    Thanks for the very helpful tutorials. I have very simple requirement which I want to implment in oracle OSB via BPEL. I have one asynchronus webservice which has two methods. Call and Recieve.

    I would like to call this asynchronous web service through BPEL and respond within the window. The challenge i am facing is how to handle a call back here. Secondly, when i create a asynchronous web service and when i am putting into partner link to generate a partner, partner link does not show me second method which i have to attach to receive call though it shows when i connect partner link to invoke.

    Can you help me with this, please I am not sure where i am wrong

    ReplyDelete
    Replies
    1. Hi,

      this should work, maybe something it wrong with your async WS or WSDL, can you test it in soapui and use a mock service for the callback.

      Thanks

      Delete
  32. Hi Edwin,
    Need your help for Picking Message from JMS topic which is in RIB database.
    My scenario is as follows:

    Topic -> PS -> BS ->file

    I have to pick message from Topic and write that to a file on server.
    Message is in RIB AQ JMS Topic.
    Now when I execute my PS it creates an empty file at the destination path on the server that I have mentioned in the BS. PS is not picking the message that is there on topic.
    I have created a Foreign JMS server and data source to connect to the TOPIC.

    Weblogic actions are are as follows:
    1- Created one data source : RibAqJmsDataSource
    2- Created one JMS Module:RibAqJmsModule
    3- Foreign Server: RibAqJmsForeignServer
    JNDI initial connection factory:oracle.jms.AQjmsInitialContextFactory
    Jndi Property: datasource=jdbc/RibAqJmsDataSource
    3-Created one ConnectionFactory:RibAqJmsXATopicConnectionFactory
    4- then the destination which is a topic.

    Now in OSB I have a PS whose endpoint is jms://ip:port/jms.RibAqJmsXATopicConnectionFactory/jms.etTransfersFromRMS.

    In the JMS Transport tab, Destination Type = Topic; Topic Message Distribution = Compatibility and One BS which has Transport = file,Protocol = file. For Endpoint URL I have file:///tmp.
    But not able to pick message from TOPIC .
    And also unable to see any logs.

    Please guide me how to proceed and what configurations need to be done for this.
    Waiting for your quick help
    Thanks in advance.

    ReplyDelete
    Replies
    1. Hi

      did you target this datasource to the right server, don't use the jndi name and make sure it is all on the osb server cause AQ is not serializable , then you should use a db url .

      Thanks

      Delete
  33. Hi,
    I am using weblogic version 10.3.6.0.
    When i executed java class TopicReceive to check my weblogic configurations...there I am getting error:

    Exception in thread "main" javax.naming.NamingException: The configuration of the AQjmsInitialContext is not complete. The configuration must contain datasource or (db_url,java.naming.security.principal,java.naming.security.credentials) or both
    at oracle.jms.AQjmsContext.incompleteConfiguration(AQjmsContext.java:87)
    at oracle.jms.AQjmsContext.(AQjmsContext.java:73)
    at oracle.jms.AQjmsInitialContextFactory.getInitialContext(AQjmsInitialContextFactory.java:37)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
    at javax.naming.InitialContext.init(InitialContext.java:223)
    at javax.naming.InitialContext.(InitialContext.java:197)
    at examples.jms.queue.TopicReceive.getInitialContext(TopicReceive.java:143)
    at examples.jms.queue.TopicReceive.main(TopicReceive.java:121)

    Waiting for help...
    Regards
    Ritika

    ReplyDelete
  34. Hi...Thanks for reply...
    Yes I am targeting to right server. What do you mean by 'Don't use JND name'..Where should I remove it from? Now I have removed [db_url,java.naming.security.principal,java.naming.security.credentials] entries from JNDI properties..Only datasource is dere.So now not getting this error message..but the flow is not working....Looks like my PS is not at all connecting or recognizing the topic..but again no error about this.
    Is this connection (OSB to RIB AQ) requires JMS Bridge?
    Waiting for quick help.......
    Thanks
    Ritika

    ReplyDelete
    Replies
    1. What I mean you need to use the datasource name as value for the datasource property and not the jndi name of the datasource. For more info see

      http://docs.oracle.com/cd/E23943_01/web.1111/e13738/aq_jms.htm

      this only works when the FS is in the same jvm as the dequeue process else you need to use db_url property

      Delete
  35. Hi,
    After doing some changes for log levels, I am getting some detailed logs for the flow.
    I am pushing the message to RIB AQ JMS Topic from my Proxy service.But no message is pushed on the destination Topic.
    Topic name:etASNOut
    URI : jms://IP:Port/jms.RibAqJmsXATopicConnectionFactory/jms.etASNOut
    Please have a look at the below trace and suggest where it is failing.


    Waiting for kind reply.

    Regards
    Ritika

    ReplyDelete
    Replies
    1. Can you check the XA parameters of the proxy and the datasource. Maybe you need to use the normal Oracle JDBC driver and disable Global transactions.

      Delete
  36. Log Trace: Part1

    AQjmsContext.lookup: enter>
    AQjmsContext.lookup: lookup return:oracle.jms.AQjmsXATopicConnectionFactory@15c8fe9c>
    AQjmsXATopicConnectionFactory.createXATopicConnection: enter>
    AQjmsDBConnMgr ctor (datasource): enter>
    AQjmsDBConnMgr.getConnection: Creating from datasource>
    <[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <004znuz0zc^5i^hMDA7EES0007W70006QQ> <1406544866217>
    AQjmsDBConnMgr.extraInit: enter>
    AQjmsDBConnMgr.extraInit: The connection class: weblogic.jdbc.wrapper.JTAConnection_weblogic_jdbc_wrapper_XAConnection_oracle_jdbc_driver_LogicalConnection>
    AQjmsDBConnMgr.extraInit: exit>
    AQjmsDBConnMgr.getConnection: generic->DB connection: [weblogic.jdbc.wrapper.JTAConnection_weblogic_jdbc_wrapper_XAConnection_oracle_jdbc_driver_LogicalConnection-RibAqJmsDataSource-19, oracle.jdbc.driver.LogicalConnection@15c9d69f]>
    AQjmsDBConnMgr.getConnection: generic->XA connection: null>
    AQjmsDBConnMgr ctor (datasource): exit>
    AQjmsConnection.setCompliant: Current is set to:true>
    AQjmsXATopicConnectionFactory.createXATopicConnection: XATopicConnection created successfully>
    AQjmsXAConnection:createXASession: enter>
    AQjmsDBConnMgr.getConnection: get the firstConn created during the authentication>
    AQjmsSession.constructor: dbversion=11203>
    AQjmsSession.setDBRatio: enter>
    AQjmsSession.setRatio: The DB csid = 871>
    AQjmsSession.setRatio: exit>
    EmulatedXAHandler.constructor: enter>
    EmulatedXAHandler.constructor: Found the transaction manager, we are running inside container.>
    EmulatedXAHandler.constructor: exit>
    AQjmsSession.constructor1: oci enabled = true>
    AQjmsSession.setMultiRetry: setting the multi_retry flag to true>
    AQjmsSession.enableEventForMsgOrder: setting the multi_retry flag to true>
    AQjmsXAConnection:createXASession: exit>
    AQjmsSession.getCompliant: Session :true>
    AQjmsSession.createTextMessage: return text message>
    AQjmsSession.getCompliant: Session :true>
    AQjmsProducer.send-2: entry>
    AQjmsProducer.publish-5: entry>
    AQjmsProducer.publish: topic: RIBAQ.etASNOut>
    AQjmsProducer.jdbcEnqueue: entry>
    AQjmsProducer.checkMessageType: adt type: SYS.AQ$_JMS_MESSAGE>
    AQjmsProducer.checkMessageType: message_class: oracle.jms.AQjmsTextMessage>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'] getLock (something.-70d9c796:1477b9d9c6f:-7fda.49) : after sync, timeout=0>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'] getLock (something.-70d9c796:1477b9d9c6f:-7fda.48) : after sync, timeout=0>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'] getLock (something.-70d9c796:1477b9d9c6f:-7fda.48) : acquired session lock, usecount=1>
    AQjmsMessage.convertHashtableToPropertyList: entry>

    ReplyDelete
  37. Log trace part2

    AQjmsMessage.convertHashtableToPropertyList: entry>
    AQjmsMessage.convertHashtableToPropertyList: exit>
    AQjmsProducer.jdbcEnqueue: destination Name: RIBAQ.etASNOut>
    AQjmsSession.getCompliant: Session :true>
    AQjmsProducer.jdbcEnqueue: set correlation:>
    AQjmsProducer.jdbcEnqueue: recipient list not specified>
    AQjmsProducer.jdbcEnqueue: visibility: 2>
    AQjmsProducer.jdbcEnqueue: JMS delivery mode: 2>
    AQjmsProducer.jdbcEnqueue: AQ delivery mode: 1>
    AQjmsProducer.jdbcEnqueue: AQ delivery mode: 1>
    AQjmsTextMessage.getGenMessageCont: entry>
    AQjmsTextMessage.getGenMessageCont: exit>
    AQjmsTextmessage.writeLob: entry>
    AQjmsUtil.writeClob: qtable: RIBAQ.ETASNOUTTABLE>
    AQjmsStreamMessage.writeClob: isAnydataDest: false>
    AQjmsSession.isKbrp: protocol:thin>
    AQjmsTexttmessage.writeLob: exit>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] releaseLock (something.someId:-7fda.48) : after sync>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] unLock (something.someId:-7fda.48) : released session lock, EXIT, usecount=0>
    AQjmsProducer.jdbcEnqueue: exit>
    AQjmsProducer.publish-5: exit>
    AQjmsProducer.send-2: exit>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] close (something.someId:-7fda.48) : ENTRY:waiting for sync>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] close (something.someId:-7fda.48) : b4 markClosed of something.someId:-7fda.49>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] close (something.someId:-7fda.48) : after markClosed of something.someId:-7fda.49>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] close (something.someId:-7fda.48) : b4 closeWait>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] closeWait (something.someId:-7fda.48) : b4 close of something.someId:-7fda.49>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] close (something.someId:-7fda.49) : ENTRY:waiting for sync>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] close (something.someId:-7fda.49) : b4 closeWait>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] close (something.someId:-7fda.49) : after closeWait>
    AQjmsProducer.localClose: ENTRY>
    AQjmsProducer.localClose: EXIT>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] close (something.someId:-7fda.49) : EXIT>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] closeWait (something.someId:-7fda.48) : after close of something.someId:-7fda.49>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] close (something.someId:-7fda.48) : after closeWait>
    AQjmsSession.closeSessionResources: entry ...>
    AQjmsSession.closeSessionResources: Closing general Connection>
    AQjmsGeneralDBConnection.close: close DB connection>

    ReplyDelete
  38. Log trace part3:

    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] close (something.someId:-7fda.48) : EXIT>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] close (something.someId:-7fda.48) : ENTRY:waiting for sync>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] close (something.someId:-7fda.48) : ALREADY CLOSED>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] close (something.someId:-7fda.47) : ENTRY:waiting for sync>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] close (something.someId:-7fda.47) : b4 markClosed of something.someId:-7fda.48>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] close (something.someId:-7fda.47) : after markClosed of something.someId:-7fda.48>
    AQjmsConnection.preClose: ENTRY>
    AQjmsConnection.preClose: EXIT>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] close (something.someId:-7fda.47) : b4 closeWait>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] closeWait (something.someId:-7fda.47) : b4 close of something.someId:-7fda.48>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] close (something.someId:-7fda.48) : ENTRY:waiting for sync>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] close (something.someId:-7fda.48) : ALREADY CLOSED>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] closeWait (something.someId:-7fda.47) : after close of something.someId:-7fda.48>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] close (something.someId:-7fda.47) : after closeWait>
    AQjmsConnection.localClose: ENTRY>
    AQjmsConnection.closeConnectionResources: Connection closed>
    [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.k.D (self-tuning)'] close (something.someId:-7fda.47) : EXIT>
    [RouteNode1, null, null, RESPONSE] ==========Rib response=============:schemas.xmlsoap.org/soap/envelope/"/>>

    ReplyDelete
  39. Hi,
    Thanks for help.
    I had created new datasource with datasource name as value for the datasource property instead of jndi name and removed check mark from Supports Global Transactions option and also used simple driver :oracle.jdbc.OracleDriver as Driver Class Name.But still not able to connect and pick or push message from Topic.
    Log says :

    ####
    <[STANDBY] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <>
    <1406552855282>


    Thanks and regards
    Ritika

    ReplyDelete
    Replies
    1. Can you check this,
      - Did you enable enqueue and dequeue on the AQ queue
      - are you connecting directly ( Datasource ) to the db user with the queue
      - Does it work in PLSQL
      -Check if you are using the right CF and Queue name in the Foreign Server so it matches with XA etc.

      Thanks

      Delete
    2. Hi Edwin,
      Thanks for your concern. I just checked the points you mentioned.
      --Default RIB installation is done so I assume that enqueue dequeue will be enabled there.I will check this again.
      --Yes I am connecting directly ( Datasource ) to the db user.
      --I tried this with BPEL and OSB only..but failed.
      --Yes I had checked my CF and topic they are correct..I followed (https://blogs.oracle.com/soaproactive/entry/jms_step_6_how_to)
      this link for ForeignServer and CF configurations

      I am trying to push as well as read message from different topics that are there in RIB ...
      While reading I am getting following following log trace:

      What does this meas No recipients for message.My destination topic is : etExtCurRate

      Regards
      Ritika

      Delete
    3. Log Trace 1::
      AQjmsConnection.setCompliant: Current is set to:true>
      AQjmsXATopicConnectionFactory.createXATopicConnection: XATopicConnection created successfully>
      [[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'] close (OJMS.Connection.HOST:ID) : ENTRY:waiting for sync>
      AQjmsConnection.preClose: ENTRY>
      AQjmsConnection.preClose: EXIT>
      close (OJMS.Connection.HOST:ID) : b4 closeWait>
      lose (OJMS.Connection.HOST:ID) : after closeWait>
      AQjmsConnection.localClose: ENTRY>
      AQjmsGeneralDBConnection.close: close DB connection>
      AQjmsConnection.closeConnectionResources: Connection closed>
      close (OJMS.Connection.HOST:ID) : EXIT>
      AQjmsXAConnection:createXASession: enter>
      AQjmsDBConnMgr.getConnection: get the firstConn created during the authentication>
      AQjmsSession.constructor: dbversion=11203>
      AQjmsSession.setRatio: The DB csid = 871>
      AQjmsSession.setDBRatio: enter>
      AQjmsSession.setRatio: exit>
      EmulatedXAHandler.constructor: enter>
      EmulatedXAHandler.constructor: Found the transaction manager, we are running inside container.>
      EmulatedXAHandler.constructor: exit>
      AQjmsSession.constructor1: oci enabled = true>
      AQjmsSession.setMultiRetry: setting the multi_retry flag to true>
      AQjmsSession.enableEventForMsgOrder: setting the multi_retry flag to true>
      AQjmsXAConnection:createXASession: exit>
      AQjmsSession.getCompliant: Session :true>
      AQjmsSession.createBytesMesage: returning bytes message>
      AQjmsContext.lookup: enter>
      AQjmsDBConnMgr.getConnection: Creating from datasource>
      AQjmsDBConnMgr ctor (datasource): enter>
      AQjmsDBConnMgr.extraInit: enter>
      AQjmsDBConnMgr.extraInit: exit>
      AQjmsDBConnMgr.getConnection: generic->DB connection: [weblogic.jdbc.wrapper.JTAConnection_weblogic_jdbc_wrapper_XAConnection_oracle_jdbc_driver_LogicalConnection-RibAqJmsDataSource-7, oracle.jdbc.driver.LogicalConnection@173b8478]>
      AQjmsDBConnMgr.getConnection: generic->XA connection: null>
      AQjmsDBConnMgr ctor (datasource): exit>
      AQjmsConnectionn ctor (datasource): type: 20>
      AQjmsConnection.setCompliant: Current is set to:true>
      AQjmsDBConnMgr.getConnection: get the firstConn created during the authentication>
      AQjmsDBConnMgr.extraInit: The connection class: weblogic.jdbc.wrapper.JTAConnection_weblogic_jdbc_wrapper_XAConnection_oracle_jdbc_driver_LogicalConnection>
      AQjmsSession.constructor: dbversion=11203>
      AQjmsSession.setDBRatio: enter>
      AQjmsSession.setRatio: The DB csid = 871>
      AQjmsSession.setRatio: exit>
      EmulatedXAHandler.constructor: enter>
      EmulatedXAHandler.constructor: Found the transaction manager, we are running inside container.>
      EmulatedXAHandler.constructor: exit>
      AQjmsSession.constructor1: oci enabled = true>
      AQjmsSession.setMultiRetry: setting the multi_retry flag to true>
      AQjmsSession.enableEventForMsgOrder: setting the multi_retry flag to true>
      AQjmsConnection:createTopicSession: Created session>
      close (OJMS.Session.HOST:ID) : ENTRY:waiting for sync>

      Delete
    4. Log Trace 2:

      AQjmsSession.preClose: ENTRY>
      AQjmsSession.inGlobalTransRechecked: entry>
      EmulatedXAHandler.inGlobalTrans: entry, reCheck=true>
      EmulatedXAHandler.checkForGlobalTxn: entry>
      EmulatedXAHandler.checkForGlobalTxn: container TM answers NOT IN global txn>
      EmulatedXAHandler.inGlobalTrans: exit>
      AQjmsSession.inGlobalTransRechecked: exit>
      AQjmsSession.preClose: abort txn>
      AQjmsSession.inGlobalTransRechecked: oracle.jms.useEmulatedXA is on>
      AQjmsSession.preClose: EXIT>
      close (OJMS.Session.HOST:ID) : b4 closeWait>
      close (OJMS.Session.HOST:ID) : after closeWait>
      AQjmsSession.closeSessionResources: entry ...>
      AQjmsSession.closeSessionResources: Closing general Connection>
      close (OJMS.Session.HOST:ID) : EXIT>
      close (OJMS.Connection.HOST:ID) : ENTRY:waiting for sync>
      close (OJMS.Connection.HOST:ID) : b4 markClosed of OJMS.Session.HOST:ID>
      close (OJMS.Connection.HOST:ID) : after markClosed of OJMS.Session...>
      AQjmsConnection.preClose: ENTRY>
      AQjmsConnection.preClose: EXIT>
      close (OJMS.Connection.HOST:ID) : b4 closeWait>
      closeWait (OJMS.Connection.HOST:ID) : b4 close of OJMS.Session.HOST:ID>
      close (OJMS.Session.HOST:ID) : ENTRY:waiting for sync>
      close (OJMS.Session.HOST:ID) : ALREADY CLOSED>
      AQjmsGeneralDBConnection.close: close DB connection>
      AQjmsProducer.send-2: entry>
      AQjmsProducer.publish-5: entry>
      AQjmsProducer.publish: topic: RIBAQ.etEXTCurRate>
      AQjmsProducer.jdbcEnqueue: entry>
      AQjmsProducer.checkMessageType: adt type: SYS.AQ$_JMS_MESSAGE>
      AQjmsProducer.checkMessageType: message_class: oracle.jms.AQjmsBytesMessage>
      getLock (OJMS.Producer.HOST:ID18) : after sync, timeout=0>
      getLock (OJMS.Session.HOST:ID15) : after sync, timeout=0>
      getLock (OJMS.Session.HOST:ID15) : acquired session lock, usecount=1>
      AQjmsMessage.convertHashtableToPropertyList: entry>
      AQjmsMessage.convertHashtableToPropertyList: exit>
      AQjmsProducer.jdbcEnqueue: destination Name: RIBAQ.etEXTCurRate>
      AQjmsSession.getCompliant: Session :true>
      AQjmsProducer.jdbcEnqueue: set correlation:>
      AQjmsProducer.jdbcEnqueue: recipient list not specified>
      AQjmsProducer.jdbcEnqueue: visibility: 2>
      AQjmsProducer.jdbcEnqueue: JMS delivery mode: 2>
      AQjmsProducer.jdbcEnqueue: AQ delivery mode: 1>
      AQjmsProducer.jdbcEnqueue: AQ delivery mode: 1>
      AQjmsBytesMessage.getGenMessageCont: entry>
      AQjmsBytesMessage.getGenMessageCont: exit>
      AQjmsProducer.jdbcEnqueue: Exception: java.sql.SQLException: ORA-24033: no recipients for message

      Delete
    5. Ok,

      change it to a Queue or add a durable AQ client listener to this topic else there is nothing to do and you won't see any messages.

      Delete
    6. Edwin we can't change it to queue..we are pointing to default TOPICS that are there inside RIB during its insallation.
      So we will go with second solution given by you.
      But how to add durable AQ client listener to this topic ..Is there any additional settings that needs to be done on OSB side or RIB side for this. Simply creating PS and BS doesn't create durable listener/Subscriber for the TOPIC?

      Thanks and Regards
      Ritika

      Delete
    7. Can you check this http://www.oracle-developer.net/display.php?id=411 and look at multiple subscribers / consumers.

      Delete
  40. Thanks Edwin for your support. Its working now. On RIB side we have some configuration differences so we are not able to trace our messages there.Now its working fine.

    Thanks you so much for guidance.

    ReplyDelete
  41. Hi,
    Is it possible to convert an Asynchronous Service to a Synchronous Service and vice-versa.
    Please do comment.

    ReplyDelete
  42. Hi,

    Hope you all doing good.
    Again in need of help regarding index variable inside for each loop in Proxy message flow.
    I am trying to use index ($index) variable in the replace activity but i getting an error saying
    [RouteNode1, Replace action] XPath expression validation failed: An error was reported compiling the XPath expression: XQuery exception: line 37, column 107: {err}XP0008 [{bea-err}XP0008a]: Variable "$index" used but not declared for expression:

    My replace activity contains:
    .//v11:Aa/v11:Ab[xs:integer($Index)]/v11:gross_cost

    I want to replace the value of node gross_cost with another variable inside loop as I have multiple 'Ab' tags in my payload.
    I tried
    1- .//v11:Aa/v11:Ab[xs:int($Index)]/v11:gross_cost ....not working.
    There is one thread also
    https://community.oracle.com/thread/2230457?start=0&tstart=0 but no luck.

    Please suggest how to perform this.

    Thanks in advance.

    ReplyDelete