OSB-12C : Creation of JMS read/write queue
JMS or Java Messaging Service is widely used technology. We can use this JMS technology in OSB elegantly.
Weblogic server supports JMS and we can create queues to read/write messages from/to external applications.
In this post I am showing how to create simple JMS read/write queue in weblogic server.
1. Login into weblogic server console (http://localhost:7008/console) locate JMS modules under services -> Messaging -> JMS Modules
2. Take session in weblogic server by clicking 'Lock and Edit' session. Click on 'New' radio button under JMS module.
3. Give proper valid name for your module. (In this post, I have used 'WriteFileModule' as my JMS Module name).
4. Let the scope be 'Global'.Click on 'Next' button.
5. Select the targets for JMS system module. Click on 'Finish'
Note : Next we need to create 'Connection Factory' and 'Queues' under modules. Hence click radio button for 'Would you like to add resources to JMS system module'.
6. Next we need to create 'ConnectionFactory'. Click on 'New' inside 'WriteFileModule' and select 'ConnectionFactory' from list.
7. Specify proper name and JNDI name for ConnectionFactory. (Here in this post i have specified 'WriteJMSConnectionFactory' same name for both). But as best practice please give proper JNDI name for connection factory.
8. Specify targets for ConnectionFactory and click on 'Finish' button. We can see message on conosle 'ConnectionFactory created successfully.
9. Next we need to create 'Queue'. Click on 'New' inside 'WriteFileModule' and select 'Queue' from list.
15. Similarly create one more JMS module,ConnectionFactory and queue and name it as below.
JMS Module : ReadJMSModule
ConnectionFactory : ReadJMSConnectionFactory
Queue : ReadJMSQueue
16. Next for testing purpose we need to create 'JMSPollingProxy' (Proxy Service) and 'Write_JMS' (Business Service). Here as OSB-12c is bundled with Jdeveloper, we are using using Jdev to create and execute proxy and business services.
Note : Please ignore 'From Template' option as of now. I will explain about 'template' in separate post.
Let Service Type of proxy service be 'AnyXML'.
Specify URI for JMS buisness service in below format.
jms://(host:port)/FactoryJNDIName/QueueJNDIName
eg : jms://localhost:8013/WriteJMSConnectionFactory/ReadJMSQueue.
Next create Business Service and name it as 'JMS_Write'.
Let Service Type be 'Messaging' with Request as 'XML' and Response as 'None'
17. Specify URI for JMS buisness service in below format.
jms://(host:port)/FactoryJNDIName/QueueJNDIName
select Message type as 'Text'.
18. Next in proxy service, add a route node and invoke 'Write_JMS' business service.
19. Next we need to do a round of testing . Here i will be sending text message from 'ReadQueue' and message will be written into 'WriteQueue'.
JMSPollingProxy will be continously polling 'ReadQueue' as and when message enters into queue, proxy will pick message and route it to 'WriteQueue' via business service
20. To send message, login into weblogic console and migrate to below mentioned path
Home -> Summary Of JMS Modules -> ReadFileModule -> Summary Of JMS Messages -> ReadJMSQueue -> Monitoring
21. Click on 'Show Messages'. Then Click on 'New'. Give proper valid xml request in body and click on OK button.
22. we can see message on conosle 'JMS Message sent successfully.'
23. Now migrate to 'WriteJMSQueue' in console
Home -> Summary Of JMS Modules -> WriteFileModule -> Summary Of JMS Messages -> WriteJMSQueue -> Monitoring
we can see number of messages in 'Message Current' tab. Click on 'show message' button.
24. click on 'MessageID' to see contents of message.
This shows that message has been successfully read from queue1 and written into queue2.
Thank you,
Tapan Hegde
Weblogic server supports JMS and we can create queues to read/write messages from/to external applications.
In this post I am showing how to create simple JMS read/write queue in weblogic server.
1. Login into weblogic server console (http://localhost:7008/console) locate JMS modules under services -> Messaging -> JMS Modules
2. Take session in weblogic server by clicking 'Lock and Edit' session. Click on 'New' radio button under JMS module.
3. Give proper valid name for your module. (In this post, I have used 'WriteFileModule' as my JMS Module name).
4. Let the scope be 'Global'.Click on 'Next' button.
5. Select the targets for JMS system module. Click on 'Finish'
Note : Next we need to create 'Connection Factory' and 'Queues' under modules. Hence click radio button for 'Would you like to add resources to JMS system module'.
6. Next we need to create 'ConnectionFactory'. Click on 'New' inside 'WriteFileModule' and select 'ConnectionFactory' from list.
7. Specify proper name and JNDI name for ConnectionFactory. (Here in this post i have specified 'WriteJMSConnectionFactory' same name for both). But as best practice please give proper JNDI name for connection factory.
8. Specify targets for ConnectionFactory and click on 'Finish' button. We can see message on conosle 'ConnectionFactory created successfully.
9. Next we need to create 'Queue'. Click on 'New' inside 'WriteFileModule' and select 'Queue' from list.
10. Specify proper name and JNDI name for Queue. (Here in this post i have specified 'WriteJMSQueue' same name for both). But as best practice please give proper JNDI name for Queue.
11. Click on 'Next' and select 'Create a New Subdeployment' option.
12. Select JMS server as Target for Subdeployments. (For this post i have created new JMS server named as 'TestXAJMSServer').
13. Once queue got created successfully, we can see message on console 'The JMS queue was created successfully.'
14. Commit the changes by clicking on 'Activate the changes' button in weblogic console.
15. Similarly create one more JMS module,ConnectionFactory and queue and name it as below.
JMS Module : ReadJMSModule
ConnectionFactory : ReadJMSConnectionFactory
Queue : ReadJMSQueue
16. Next for testing purpose we need to create 'JMSPollingProxy' (Proxy Service) and 'Write_JMS' (Business Service). Here as OSB-12c is bundled with Jdeveloper, we are using using Jdev to create and execute proxy and business services.
Note : Please ignore 'From Template' option as of now. I will explain about 'template' in separate post.
Let Service Type of proxy service be 'AnyXML'.
Specify URI for JMS buisness service in below format.
jms://(host:port)/FactoryJNDIName/QueueJNDIName
eg : jms://localhost:8013/WriteJMSConnectionFactory/ReadJMSQueue.
Next create Business Service and name it as 'JMS_Write'.
Let Service Type be 'Messaging' with Request as 'XML' and Response as 'None'
17. Specify URI for JMS buisness service in below format.
jms://(host:port)/FactoryJNDIName/QueueJNDIName
select Message type as 'Text'.
18. Next in proxy service, add a route node and invoke 'Write_JMS' business service.
19. Next we need to do a round of testing . Here i will be sending text message from 'ReadQueue' and message will be written into 'WriteQueue'.
JMSPollingProxy will be continously polling 'ReadQueue' as and when message enters into queue, proxy will pick message and route it to 'WriteQueue' via business service
20. To send message, login into weblogic console and migrate to below mentioned path
Home -> Summary Of JMS Modules -> ReadFileModule -> Summary Of JMS Messages -> ReadJMSQueue -> Monitoring
21. Click on 'Show Messages'. Then Click on 'New'. Give proper valid xml request in body and click on OK button.
22. we can see message on conosle 'JMS Message sent successfully.'
23. Now migrate to 'WriteJMSQueue' in console
Home -> Summary Of JMS Modules -> WriteFileModule -> Summary Of JMS Messages -> WriteJMSQueue -> Monitoring
we can see number of messages in 'Message Current' tab. Click on 'show message' button.
24. click on 'MessageID' to see contents of message.
This shows that message has been successfully read from queue1 and written into queue2.
Thank you,
Tapan Hegde






































Comments
Post a Comment