1

[environment: java ee 6, jms 1.1, wildfly 10, wmq 9]

I have to set up 9 Message Driven Beans that listen to different topics on 3 different servers:

  • 1 Topic in DEV
  • 4 in PROD
  • 4 in TEST (one for each in PROD)

The problem is that the topics are restricted to their respective servers, meaning that if for instance I deploy the TEST and PROD beans in DEV, I get a connection error and the deployment fails. Same if I deploy the DEV and PROD beans from TEST etc. It only works if I 'comment out' the beans belonging to the other zones. It is obviously not a solution because the same code has to be deployed to all servers.

So I am desperately trying to find a way to somehow externally enable/disable the beans, depending on which server the application is deployed in.

... OR to somehow ignore if a bean could not connect, so the deployment is still successful and does not affect the listeners of the respective server.

Also open to any other idea on how to tackle this.

Thanks in advance!

djobbagy
  • 25
  • 4
  • 1
    Shouldn't you use the same MDB and change the config to target the topics ? – ehsavoie Oct 30 '20 at 14:12
  • That would work if I had the same number of MDBs in each zones. – djobbagy Oct 31 '20 at 15:13
  • Did my answer address your question? – Justin Bertram Nov 29 '20 at 14:38
  • Oh thanks for following up. It was a good idea and I tried implementing it but I was unable to do the activation on the CLI as the MDBs were simply not listed where they should have been based on the documentation. Maybe it is a JBoss-only feature and does not work on Wildfly 10? Not sure. Thanks for your help anyway, I'll go and accept your reply. – djobbagy Nov 30 '20 at 15:07

1 Answers1

0

I recommend either using the the active element in the MDB's jboss-ejb.xml deployment descriptor or the @DeliveryActive annotation on the MDB itself. If you use the latter then you can activate the MDB administratively via the CLI if necessary. See the documentation for more details.

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43