Pages

Tuesday, June 21, 2011

Configure and test JMS based EDN in SOA Suite 11g

Beside the default AQ implementation it is also possible to use a JMS Queue for EDN. When you use the JMS implementation in SOA Suite 11g instead of AQ, it can be easier to publish an event from a Java Web application, WebLogic SAF, MDB or from OSB. In this blogpost I will show you how to configure EDN-JMS and how to publish an Event to this JMS Queue.

When you take a look at the SOAJMSModule located at the JMSModules of WebLogic you can see that the module already contains an EDN Queue and an EDN ConnectionFactory.

So you only need to configure SOA Suite so it uses this Queue and Connection Factory. To do so open the enterprise manager application | SOA | soa-infra and open the Common Properties Menu item of the SOA-Infrastructure menu. Click on More SOA-Infra Advanced Configuration Properties


This will open the System MBean Browser. In this we can change the EdnJmsMode and set this to true.

Restart the SOA Server and take a look at the monitoring of the EDN Queue. Here you must see there are some Queue Consumers
Second part of this blog is to publish a event. For this I made a simple Employee Id XSD which can be published.

Create a SOA Project and add a Mediator with a One Way Operation which uses this XSD. Also expose this Mediator so you can invoke this operation from the Enterprise Manager.

Add a routing rule and choose for an Event.
 Define an Employee Event.

Add a transformation and map the source and destination elements

Your composite will look like this.  Deploy the composite to the SOA Server.

To see the event you need to pause the consumption of the EDNQueue.

Open the Enterprise Manager and test the service of the EDN composite.

Go back to the EDNQueue and look at the JMS Message. It contains some SOA instance tracing elements and has a MessageType JMS Header which defines the EDN mode.


In the following documentation you can read about, how to create a Foreign JNDI provider on your ADF server so you can publish JMS EDN events from an ADF Client.

38.3.6 How to Configure JMS-based EDN Implementations

In one of the future blogposts I will publish an JMS event from a Java Client.

27 comments:

  1. hey this information is really great regarding oracle fusionware
    Regards
    Ritu

    oracle fussion middleware

    ReplyDelete
  2. Nice Post. Thanks.. I've tried the steps. but I can't see the message on the JMSQueue. I've sent the message thru the EM'S test console, but the message is not appearing in the JMSQueue. What must be the problem. Kindly suggest.

    Note:I'm using same version of SOA Suite and Jdev(11.1.1.5.).

    Thanks
    Ananth

    ReplyDelete
  3. Hi,

    Do you see some activity on queue and did you paused the consumption of the queue.

    thanks

    ReplyDelete
  4. I Paused the consumption of the queue and there is no activity on queue.

    ReplyDelete
  5. Hi,

    Just a few checks , is the mbean attribute still on jms and did you restart all the servers.

    Thanks

    ReplyDelete
  6. I set the EdnJmsMode is true. I restarted the SOA Server and Admin Server. Paused the consumption of the queue. but can't see any activities/messages on queue.

    Thanks

    ReplyDelete
  7. If I want to use default AQ implementation for EDN, Do I need to do any configuration changes? and with default AQ implementation,
    how do I publish Events to EDN using java?

    ReplyDelete
  8. Hi

    Aq is the default. for a java aq client look at this https://guidoschmutz.wordpress.com/2010/01/12/using-the-event-api-to-publish-an-event-to-the-event-delivery-network-edn-the-spring-way/

    thanks

    ReplyDelete
  9. Hi Edwin just like Ananth I cant see anything going to the the EDNQueue.
    Just an observation, you started with the EDNQueue and when you restarted the server after the configuration it changed to SOAJMSModuleEDNQueue ?? Did you rename or is it a new Queue you created?
    Please throw some light on this.

    my email is naggarwal@gmail.com

    ReplyDelete
  10. Hi,

    SOAJMSModuleEDNQueue is the name where the real implementation of the queue is running ( jms module / server ), in this case EDNQueue queue is running on the SOAJMSModule.
    When you have a distributed queue or targeted on more then one server then you will see more then one

    I will retest it.

    Thanks

    ReplyDelete
  11. Hi,

    I retested it with SOA PS3 , normal installation , no developer install and it works perfectly

    thanks

    ReplyDelete
  12. I did realise that the QueueName wasn't the issue.

    But Not sure what we are doing wrong.

    I am running this on a SOA 11.1.1.1.4 with an admin and a managed server on my dev box.

    Are the following Queue settings correct ?
    Name SOAJMSModule!EDNQueue
    ProductionPaused false ConsumptionPaused true
    InsertionPaused false


    Is there a way to find out what messages have been going to the queue without pausing it/ as its not working for me

    Also even though it doesnt look like an issue with the code can you share your code so that I can see if there is anything in the configuration of the Event.

    Regards
    Nitin Aggarwal

    ReplyDelete
  13. I have managed to get this working... It worked once I deployed the listener code to the server. I presume that it was throwing away the messages if there were no subscribers to the queue.

    I would recommend you add that to the post.

    Thanks for your help

    ReplyDelete
    Replies
    1. Hi Nitin,

      you said you deployed the listener code to the server..so, what is the code you are talking about here, is it the mediator service that listens ( subscribes ) to the queue as above or do we need a listener separate code.

      My requirement is i have to raise a business event. for this i wrote a JMS client as mentioned here in the post: http://biemond.blogspot.com/2011/06/publish-to-edn-from-java-osb-with-jms.html and could post the message to the queue.

      Now I created a mediator component as stated in this post with the configurations set to JMS. Now the mediator component is not listening to the Queue and the message is not getting consumed.

      So, do i need to run a separate listener class to subscribe to the queue ? Can't the mediator service consume the message from the JMS.

      please advise.

      Thanks,
      Srini




      Delete
    2. Can you make a dummy edn produce and consume composite process and see if jms edn works.

      thanks

      Delete
    3. Hi Edwin,

      Dummy EDN produce and consume composite process works with JMS.

      1.) From EM console I did set the EdnJmsMode to true.
      2.) Created the Event Definition File.
      3.) created a composite with Mediator to subscribe to the events and deployed the composite.
      4.) From the EM console, published the Business Event with sample payload.
      5.) In the JMS queue i could see the message coming in and being consumed by the Mediator composite.

      Next is, i want to publish the Business Event from a JMS client, not from the EM console as we did in step 4 above and want to consume the message with the same Mediator Component we created above.

      So,I created a JAVA client to post the message to EDNJMSQueue (jms/fabric/EDNQueue ).

      referred: http://biemond.blogspot.com/2011/06/publish-to-edn-from-java-osb-with-jms.html


      Now as in step 5 above i could able to see the message in the Queue but not being consumed by the Mediator composite.

      Do i need to change any configuration in the Mediator Composite ? or Do i need to write a separate listener code to consume the message from the Queue.
      Since the message is being posted to the same EDNJMSQueue, can't the Mediator Composite consume it as in step 5 above.

      I might be missing something here, your help is appreciated.

      Thanks,
      Srini.

      Delete
    4. hi
      can you check the message and jms header properties this should be same as your dummy produce. and are you connecting to the soa server. you can also use a qbrowser to put the message direct in the queue.

      thanks

      Delete
    5. Edwin,

      I am connecting to the soa server. Following are the header properties.

      The MessageType differs and the Sidecar content differs and i am using the same JMS client as in your other post, no change..

      Publishing via EM console.

      Sidecar: ns:ErrorEventNotification-sidecar XX_TEST/SubscribeToErrorNotificationEvent!1.0*soa_e4d1ccf2-209f- 4506-94ef-50dff4bd8f49SubscribeToErrorNotificationEvent $publisher ccaein

      Message Type: IntOneAndOnlyOne
      JMSXDeliveryCount: 0


      Publishing via JMS client:

      Sidecar:: ns:ErrorEventNotification-sidecar

      Message Type: Remote
      JMSXDeliveryCount: 0

      Thanks,
      Naga

      Delete
    6. Hi Edwin,

      I am connecting to the SOA server.

      Publishing via EM console.

      Sidecar: ns:ErrorEventNotification-sidecar XX_TEST/SubscribeToErrorNotificationEvent!1.0*soa_e4d1ccf2-209f- 4506-94ef-50dff4bd8f49SubscribeToErrorNotificationEvent $publisher ccaein

      Message Type: IntOneAndOnlyOne
      JMSXDeliveryCount: 0


      Publishing via JMS client:

      Sidecar:: ns:ErrorEventNotification-sidecar

      Message Type: Remote
      JMSXDeliveryCount: 0

      when using the qbrowser i the message is sitting in the Queue, but there the Message Type is missing.

      Please advise.

      Thanks,
      Srini

      Delete
    7. Hi,

      Message Type is always remote when you do it from outside the soa suite. Can you use exactly the same Sidecar and see if that works.
      and then remove some data until it fails.

      thanks

      Delete
  14. Ok, thanks

    Publishing from java or OSB should lead to message in a queue and activity . This by passes SOA code.

    From edn publishing composite can be clever and detects there are no listeners

    ReplyDelete
  15. Hi Edwin,

    I followed the steps given in developer guide to publish events to remote web logic. I have created foreign JNDI as said. But Messages are not getting posted to remote weblogic EDN queue.

    Please throw some light on this.
    If you have any documents related to this please share.

    Regards
    PavanKumar.M

    ReplyDelete
  16. Hi,

    Do you have a composite listening for edn events and can you try to publish it from java.

    http://biemond.blogspot.com/2011/06/publish-to-edn-from-java-osb-with-jms.html

    thanks

    ReplyDelete
  17. Hi Edwin,

    I am able to successfully publish the events to the JMS queue, using a BPEL process, but I tried all the steps you menetioed for Mediator, but it did not work not sure why.

    Anyways I have a question why the "Consumers Total" is 1458 in your above picture.

    In my case it is increasing after every second and it is now 6703, I believe these are the instances of the MDB's listing to this queue. but how come it is increasing after every second..



    Awais

    ReplyDelete
    Replies
    1. Hi,

      Can you deploy the mediator first and test the EDN event in the EM and after that deploy the BPEL producer.
      Crazy numbers indeed , looks like the soa JMS implementation is not so well developed. Does it stays so high and keep increasing.

      Thanks

      Delete
  18. The event is created, in SOAJMSModule!EDNQueue the message is there, but its subscriber does not read (composite does not start)

    ReplyDelete
  19. Hi im also encountering this issue.

    The event is created, in SOAJMSModule!EDNQueue the message is there, but its subscriber does not read (composite does not start)

    ReplyDelete