I hope you already have a basics of the JMS concpet, a bit more about it in different way.
1. when to use JMS or when a test case or secanrio to eligible for use JMS?
1. When you want to decouple an application and keep it loosly coupled with
other systems/modules.
2. When your application is growing and has growing responsibility to maintain
interaction with modules.
3. While communicating with other system there has to be no need of waiting for response
immideatly, I would rather say that if you design application to communicate with other system
asyncronously.
in all above case it is preferred to use JMS as a way for communiation protocol.
these are few examples where JMS can be used efficiently...
1. in your saving account you have sms alert on transactions.
2. you submit your tax processing appliction.
3. request for checkbook order
4. request for transaction details report (that will be emailed)
5. monitoring system which audits data based on events.
I would also like to share that there will be more different exampls which may look like can be build
only with syncronus communication, but they can be designed differently in such a way to work with JMS
as to improve performance of the system and scalability.
Lets take an example of banking application now.
I have a banking application which has integral module within that sends email and sms
on transaction processiing. now bank is devleloping another module which is a pesonal
goal module where use specify his saving goal and once it is achieved it will send sms
there also new module need to be added about alter of new bills payment that customer have to pay.
now think that if the banking application was desingned earlier in such a way that this small
sms/email module was developed as a integral part of system and as more and more functionality
gets added its become difficult to maintain and provide different features/ integrate with different
module. (this is a simple scenario presented here don't think of too much of complexity or alternatives)
lets try to design it as a loosly coupled system.
assume that bank has a independant module deployed on the server along with banking application
and both communicate over JMS because banking appliation do not need any feedback after it post
message for sending email or sms, rather confirming customer that request processed.
OK now who is consumer and who is producer?, what type of JMS messaging it is?
in this case your sms/email module is a consumer of the message as it process message for sending email or sms.
and your bank application is a producer of the message who send the request to process message.
and this is queue based message processing because response (sms/email) is intended to one recepient only.
Lets try to create a sample application both bank and sms module and deploy on weblogic server
here I am using weblogic as a JMS server hope you know that weblogic provides JMS Server functionality also.
else you can use different server as well, but concept is same.
Step 1. setting up of JMS Server on weblogic
1. click on jms server >> summery of jms server>> new
2. type the name of jms server you desired, persistance store: either select if you have one or create new
3. persistance store is of two type file and jdbc, select file store as persistance store, which means your messages are
persisted in file. >>next
4. enter the name for file store, target is admin server since it is not cluster or managed server, also make of note
given on sever for directory
*The pathname to the directory on the file system where the file store is kept.
*This directory must exist on your system, so be sure to create it before completing this tab.
so create directory and enter the path. >>next
5. Console will come back to same page of step 3 select file store and click next.
6. select jms server target and click finish.
Setp 2 set up jms module
1.from the top again go to summery of jms services >>jms module>> new
2. enter name of the module,description, location in domain can be left blank, >> click next
3.select target as admin server>> next
4. select add resources to jms module >> click next.
step 3. Setup Connection Factory and Queue
in last step of 2 will create module and take you to resources page where you can define jms queue now.
1. Click new >> select Connection factory >> click next
2. Enter jms factory name and jndi name… that is only important now. subscription policy exclusive, clientid policy unrestricted
max message 10, xa conn.. unchecked
3.click next >>and select adminserver>> next/finish
4.You are back again on summary of resources page Click again on new >> select queue option >> next
5. Enter the queue name and its jndi name, template none>>click next
6.Click on create new subdeployment>> Enter the subdeployment name>>ok
7. select subdeployment >>target will be shown previously created jms server select and >>finish
with this we are finish with setting up jsm server and queue now we will create java provider class
I have attached the screen shots and sample example as link here.
jms-screenshots.doc
jms-screenshots.docx
BankAppSMSSender.java >> is a simple jms producer which generated message and post it on server
SMSProcesssor.java >> is the consumer which reads message from jms server and process it.
Soon I will write on them more...
1. when to use JMS or when a test case or secanrio to eligible for use JMS?
1. When you want to decouple an application and keep it loosly coupled with
other systems/modules.
2. When your application is growing and has growing responsibility to maintain
interaction with modules.
3. While communicating with other system there has to be no need of waiting for response
immideatly, I would rather say that if you design application to communicate with other system
asyncronously.
in all above case it is preferred to use JMS as a way for communiation protocol.
these are few examples where JMS can be used efficiently...
1. in your saving account you have sms alert on transactions.
2. you submit your tax processing appliction.
3. request for checkbook order
4. request for transaction details report (that will be emailed)
5. monitoring system which audits data based on events.
I would also like to share that there will be more different exampls which may look like can be build
only with syncronus communication, but they can be designed differently in such a way to work with JMS
as to improve performance of the system and scalability.
Lets take an example of banking application now.
I have a banking application which has integral module within that sends email and sms
on transaction processiing. now bank is devleloping another module which is a pesonal
goal module where use specify his saving goal and once it is achieved it will send sms
there also new module need to be added about alter of new bills payment that customer have to pay.
now think that if the banking application was desingned earlier in such a way that this small
sms/email module was developed as a integral part of system and as more and more functionality
gets added its become difficult to maintain and provide different features/ integrate with different
module. (this is a simple scenario presented here don't think of too much of complexity or alternatives)
lets try to design it as a loosly coupled system.
assume that bank has a independant module deployed on the server along with banking application
and both communicate over JMS because banking appliation do not need any feedback after it post
message for sending email or sms, rather confirming customer that request processed.
OK now who is consumer and who is producer?, what type of JMS messaging it is?
in this case your sms/email module is a consumer of the message as it process message for sending email or sms.
and your bank application is a producer of the message who send the request to process message.
and this is queue based message processing because response (sms/email) is intended to one recepient only.
Lets try to create a sample application both bank and sms module and deploy on weblogic server
here I am using weblogic as a JMS server hope you know that weblogic provides JMS Server functionality also.
else you can use different server as well, but concept is same.
Step 1. setting up of JMS Server on weblogic
1. click on jms server >> summery of jms server>> new
2. type the name of jms server you desired, persistance store: either select if you have one or create new
3. persistance store is of two type file and jdbc, select file store as persistance store, which means your messages are
persisted in file. >>next
4. enter the name for file store, target is admin server since it is not cluster or managed server, also make of note
given on sever for directory
*The pathname to the directory on the file system where the file store is kept.
*This directory must exist on your system, so be sure to create it before completing this tab.
so create directory and enter the path. >>next
5. Console will come back to same page of step 3 select file store and click next.
6. select jms server target and click finish.
Setp 2 set up jms module
1.from the top again go to summery of jms services >>jms module>> new
2. enter name of the module,description, location in domain can be left blank, >> click next
3.select target as admin server>> next
4. select add resources to jms module >> click next.
step 3. Setup Connection Factory and Queue
in last step of 2 will create module and take you to resources page where you can define jms queue now.
1. Click new >> select Connection factory >> click next
2. Enter jms factory name and jndi name… that is only important now. subscription policy exclusive, clientid policy unrestricted
max message 10, xa conn.. unchecked
3.click next >>and select adminserver>> next/finish
4.You are back again on summary of resources page Click again on new >> select queue option >> next
5. Enter the queue name and its jndi name, template none>>click next
6.Click on create new subdeployment>> Enter the subdeployment name>>ok
7. select subdeployment >>target will be shown previously created jms server select and >>finish
with this we are finish with setting up jsm server and queue now we will create java provider class
I have attached the screen shots and sample example as link here.
jms-screenshots.doc
jms-screenshots.docx
BankAppSMSSender.java >> is a simple jms producer which generated message and post it on server
SMSProcesssor.java >> is the consumer which reads message from jms server and process it.
Soon I will write on them more...
No comments:
Post a Comment