spring jms example

Posted on 2014-08-03
Medium Priority
Last Modified: 2014-08-07

what is the importance of annotation-config ,Qualifier annotation. when to you use which one.  Please advise

I read annotation-config enable annotation based injection.
when to use @Resource. How specifying queue and topic are different.
Please advise
Question by:gudii9
  • 3
  • 2
LVL 35

Accepted Solution

girionis earned 2000 total points
ID: 40238444
@Qualifier is used when you have more than one bean of the same type and you want to specify which one will be injected. For an exampel have a look here.

Yes, the annotation-config enables annotation based injection.

The @Resource uses a different post processor than @Autowired and @Inject and it matches first by name and then by type. For a comparison of all injection annotation have a look here.

Queue is used when you want to send a message to one subscriber. Topic is used when you want to send a queue to several subscribers.

Author Comment

ID: 40242386
is there is a simple example with database(say mysql) interaction also. I see lot of real time projects using database as well. Please advise
LVL 35

Expert Comment

ID: 40243283
What do you mean? Save the message in the database as well? If yes then this shouldn't be different from any other database interaction.

Author Comment

ID: 40244228
What do you mean? Save the message in the database as well?

Yes doing some CRUD operations on the database(say mysql) including saving , deleting, modifying data/messages. I have installed mysql and workbench mysql IDE on my laptop.
LVL 35

Expert Comment

ID: 40245574
You should save it independently of the JMS queue. Do what ever you have to do with the database and then send the message to the queue.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses
Course of the Month16 days, 12 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question