fitnesse, JMS and Spring framework - Sajha Mobile
SAJHA MOBILE
fitnesse, JMS and Spring framework
Posts 10 · Viewed 4959 · Go to Last Post
GoneCrazy
· Snapshot 0
Like · Likedby · 0
Hi Sajha mitra haru,

Is there anyone who has knowledge about testing JMS message and sending the message in the message queue using the fitnesse tool. I need an urgent help and also some configuration help. I am dead in water as the examples in google are very simple and will not be able to test the messages.
The JMS is created using the Spring Framework.
This is something new to me and any help would be appreciated. If anyone has successfully implemented this, please let me know.
sojoketo
· Snapshot 19
Like · Liked by · 0
why are you using JMS?
queue or Topic?
what are you trying to accomplish and how are you trying to test?
what application server you are using?

These details kind of matters!
NE_Patriots
· Snapshot 22
Like · Liked by · 0
Crazy,

Tell me your use case? What are you testing?

For getting started with the Spring JMS template, read these examples from Spring.
http://docs.spring.io/spring/docs/current/spring-framework-reference/html/jms.html

Above example will tell you how to send a message in a queue/topic and how to hook up a JMS listener.

Let me know if you need more help on the Spring JMS template.

And if you just want to test the queues manually then you can use GUI tools like GEMS, JMS browser etc.

NE_Pats
GoneCrazy
· Snapshot 48
Like · Liked by · 0
Hi,

Requirement is to send the xml request to the queue and read the message from the queue.
When the message is send as xml to the JMS queue, I need to validate the process is working. For example: I need to test the ping operation. In ping, I need to send the message to the first factory where it generates the key and then uses it as a request for second queue. Similarly, there are 4 steps before the message is generated. So, for the ping operation, I need to test all the four steps involved.
To achieve this, I need to send the test data in the fitnesse format and post the response from the test to the fitnesse.
NE_Patriots
· Snapshot 169
Like · Liked by · 0
Ok. So I went through this FitNesse framework here : https://www.youtube.com/watch?v=KQa3kJIyOS8

So that framework is just for testing any java classes like JUnit or TestNG and has nothing to do with JMS.

So for testing your JMS queues you need to write java code using Spring framework and initialize those jms beans in the application context.

So this Spring JMS Template will have all the class you need to send message to a queue and receive (OnMessage()). You just need to write classes and call those methods.

Go through this to create your simple JMS message and test first using Junit.
sojoketo
· Snapshot 190
Like · Liked by · 0
These are the terms to be accounted for JMS
JMS Sender
JMS Listener
JMS Template
onMessage()

JMS configuration needs to be setup in APP server(webspher, JBoss or other)
Also needs to configure JMS stuff in spring application context file too.

Will provide you more details if time allows.




GoneCrazy
· Snapshot 213
Like · Liked by · 0
Thanks @NE_Patriots and @sojoketo. I will look more into it. I need to have some sort of framework idea present by next week and simple configuration of JMS message testing.
I am new to JMS and fitnesse. Although I looked into fitnesse, I only get simple examples and which I have already implemented.
As for JMS, I get from you guys that JMS template is what I need to use. I will dig more into it and see how can I test it.
At the same time, if you guys can provide me more information about the infrastructure setup that would be more helpful. :)

Thanks
GoneCrazy
sojoketo
· Snapshot 257
Like · Liked by · 0
what application server you are using?
I will provide you more details soon.
sojoketo
· Snapshot 305
Like · Liked by · 0
- JMS is used for asynchronous transaction. ( i assume you know what is asynchronous transaction)
- JMS queue for only one consumer (NOTE: for Queue, In cluster environment, you need to handle it as there would be multiple consumers)
- JMS topic for multiple consumers

CONFIGURATION PART
(goggle it for configuration doc. You may get one)

In your application server (Websphere, JBOSS)

1. create bus
2. create queue
3. create queue connection factory (JMS provider)and select bus(the one you created)

Then need to configure queue.

--------------------------
Classes:
JMSQueueSender class
//send the xml request to the queue
- send(//it can take parameter depending on your requirement) {

jmsTemplate.send("your queue", new MessageCreator() {
public Message createMessage(Session session) throws JMSException {

//set message property
// your xml request object

           return message;
     }
  })
}


JMSQueueListener class

- onMessage(Message message){
// get message property you set
// validate or other functionality 
}

--------------------

In spring application context, you need to inject/initialize/configure your bean and spring jms container
(google it)
Last edited: 08-Apr-15 01:23 AM
GoneCrazy
· Snapshot 356
Like · Liked by · 0
Thanks @sojoketo, I will look into all the topics you mentioned.
Please log in to reply to this post

You can also log in using your Facebook
View in Desktop
What people are reading
You might like these other discussions...
· Posts 16 · Viewed 2323 · Likes 3
· Posts 1 · Viewed 92
· Posts 1 · Viewed 82
· Posts 4 · Viewed 446
· Posts 1 · Viewed 111
· Posts 1 · Viewed 105
· Posts 1 · Viewed 225
· Posts 6 · Viewed 840
· Posts 1 · Viewed 205
· Posts 1 · Viewed 388



Your Banner Here
Travel Partners
Travel House Nepal