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.

15 comments:

  1. 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
  2. Hi,

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

    thanks

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

    ReplyDelete
  4. Hi,

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

    Thanks

    ReplyDelete
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. Hi,

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

    thanks

    ReplyDelete
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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