Guest User

Message-driven bean

a guest
Aug 27th, 2012
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.95 KB | None | 0 0
  1. package cz.sedlackovi.test;
  2.  
  3. import javax.ejb.ActivationConfigProperty;
  4. import javax.ejb.MessageDriven;
  5. import javax.jms.Message;
  6. import javax.jms.MessageListener;
  7.  
  8. import org.jboss.ejb3.annotation.ResourceAdapter;
  9.  
  10. /**
  11.  * Message-Driven Bean implementation class for: MDB
  12.  *
  13.  */
  14. @MessageDriven(
  15.         activationConfig = { @ActivationConfigProperty(
  16.                 propertyName = "destinationType", propertyValue = "javax.jms.Topic"
  17.         ),
  18.         @ActivationConfigProperty(
  19.                 propertyName = "destination",
  20.                 propertyValue = "topic/avesEntityMessages")})
  21. @ResourceAdapter("hornetq-ra")
  22. public class MDB implements MessageListener {
  23.  
  24.     /**
  25.      * Default constructor.
  26.      */
  27.     public MDB() {
  28.         // TODO Auto-generated constructor stub
  29.     }
  30.    
  31.     /**
  32.      * @see MessageListener#onMessage(Message)
  33.      */
  34.     public void onMessage(Message message) {
  35.         System.out.println("zprava prisla: " + message);
  36.        
  37.     }
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment