In this post, I just want to present an idea on how to make Service Bus work with EDN in SOA Suite 12c. For demonstration purpose, I will consider Durable Subscriber functionality introduced in 12c.
You can download the SOA and Service Bus projects here and here.
My setup includes 2 business events Create Order and Update Order and have the following durable subscribers created because of SOA Composites. Refer to these articles for more information on EDN. Note that, Client ID is different as mentioned below based on the consistency level used for the event subscription.
For Guaranteed -> edn_wljsm_localtx_client
For OneandOnlyOne -> edn_wljsm_xa_client
Main idea is to create a durable subscriber for our Proxy Service similar to the ones shown below. So note down Client ID and Message Selector shown below and use it in our Proxy Service configuration. Here we are subscribing our Proxy Service to Create Order business event.
Now create Proxy Service and set Endpoint URI in Transport tab as shown below. EDN uses EDN Topic for storing and delivering the EDN messages to subscribers.
Give the Message Selector and Client ID noted in previous step in Transport Details tab as shown below and select Durable Subscription option.
Deploy you Service Bus project and observe that another durable subscriber has been created for Proxy Service as shown below.
To make sure that things are working as expected, push the message read by Proxy service to other JMS queue. Here I created queue named CustomJmsQ and following screenshot shows no messages are pushed yet.
Raise the Create Order business event from SOA Composite. And you can observe that message payload have been inserted into JMS queue.
Shut down OSB managed server and observe status of durable subscriber. As shown below the Active status is shown as false indicating that Proxy service is not longer ready to accept messages.
Again raise the Create Order business event. And now you can observe that message is shown in Current Count means not yet delivered to Proxy Service.
Now restart your OSB managed server navigate to CustomJmsQ. Now you can observe 2 messages in this queue including the latest one as shown below.
Now Un-deploy Service Bus project. And you can observe that corresponding durable subscriber is deleted too.
Remember the following:
- EDN bus comes with SOA server, so you may not be able to use EDN in OSB only deployments.
- Since there is no native support for business events in service bus, we will not be able to set any consistency levels and even the retry would not happen similar to SOA composites.
- Here we directly gave Endpoint URI of Proxy Service to point to EDNTopic residing different server. Ideally, you may have to go for foreign server.
- Finally, I have not verified the same with client edn_wlsjms_xa_client. Please let me know in comments when you try.
Hi Siva,
Thanks for the beautiful post.
Can you please tell if there is a way to publish EDN event directly from OSB(without going through SCA).
If yes, it would be great if you can explain.
Thanks in advance !!
Kind Regards,
Prateek
theoretically, it will work as now 12c using JMS as the default for EDN and from OSB we can just publish to the topic with proper EDN message. I will try some time.
Reblogged this on Dinesh Ram Kali..