Simple annotation based MDB in JBoss


/ Published in: Java
Save to your folder(s)

An example of an annotated MDB in JBoss with some interesting. options


Copy this code and paste it in your HTML
  1. @MessageDriven(
  2. activationConfig = {
  3. @ActivationConfigProperty(
  4. propertyName = "destinationType",
  5. propertyValue = "javax.jms.Queue"),
  6. @ActivationConfigProperty(propertyName = "destination",
  7. propertyValue = "queue/DummyQueue"),
  8. @ActivationConfigProperty(propertyName = "MaxPoolSize",
  9. propertyValue = "3"),
  10. @ActivationConfigProperty(
  11. propertyName = "acknowledgeMode",
  12. propertyValue = "Auto-acknowledge")})
  13. public class DummyMDBean implements MessageListener {
  14.  
  15.  
  16. public void onMessage(final Message message) {
  17. // your logic goes here
  18. }
  19.  
  20. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.