Simple Java Message Service programming and EJB MDB

Source: Internet
Author: User
Tags jboss jboss server

Today, Java Message Service and message-driven bean are simple programming. It is mainly to import the JMS package and use the jms api for programming. The concept is also clear, that is, how to use JMS is basic.

MainlyUse a queue for one-to-one message publishing; and topic for one-to-multiple, or multiple-to-many message Publishing. The message will be automatically saved by the JBoss queue and topic, and the queue and topic have been bound to the JNDI,

Later, the client may be on the other side of the ocean, as long as you want to publish messages on the queue or topic on the JBoss server. Of course, you can use JNDI to find the queue or topic.

Note that,For example, when creating a clientProgramAll the packages under JBoss/client must be included.This also makes sense, that is, JBoss gives you its own program interfaces and services.

Simply put, the client sends a message to a myqueue and mytopic respectively, deploys two MDB that accept myqueue and three MDB that accept mytopic on JBoss, And then you can see that, at most one MDB consume that accepts myqueue has this message, while three MDB that accept mytopic have consume messages.

ReflectedQueue is 1-to-1; topic is one-to-many or many-to-many message mode.

What is the purpose of MDB? Wait for the project.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.