Dynamic JMS Queue Creation in WildFly
arunkumaraswamy May 23, 2017 6:40 AMHello Everyone,
I'm just new to wildfly and require your support in creating the dynamic JMS queues for my application. Kindly guide me and let me know the steps i follow are having issues.
Let me summarize the need which i'm looking and trying out with WildFly 9.0.2 Final.
The application which i'm working now works with Jboss AS 6.1.0, and we are in process of migrating it to wildfly versions. We are in the initial analysis of its feasibility and facing issues with JMS queue creation from the application which we are deploying.
The application presently uses JMX to create a queue. We decided to move to jboss-cli and used the wrapper ( Advanced CLI scripting with Groovy, Rhino, Jython, etc. ) from this link to create a JMS queue (Hornet Queue as of now).
The standalone jboss-cli command while running creates the queue as exepcted (jms-queue add --queue-address=sampleQueue --entries=java:jboss/exported/jms/queue/sampleQueue). With the wrapper code's normal java execution also creates the queue as expected.
CLI cli = CLI.newInstance();
cli.connect();
Result result = null;
String queueId = "sampleQueue";
result = cli.cmd(“jms-queue add --queue-address="+queueId+" --entries=java:jboss/exported/jms/queue/" + queueId)
ModelNode response = result.getResponse();
System.out.println(response.get("outcome").asString().equals("success"));
cli.disconnect();
When i include the queue creation logic (java code) with my application war, and this logic when gets executed as part of the deployment (due to some configuration triggers) the application deployment hangs and fails subsequently.
// note we have adjusted the "jboss.as.management.blocking.timeout" to 300. and it doesn't helped in the deployment.
The error logged onto the server logs are as below.
2017-05-16 14:22:02,747 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 2) WFLYCTL0348: Timeout after [300] seconds waiting for service container stability. Operation will roll back. Step that first updated the service container was 'deploy' at address '[("deployment" => "app.war")]'
2017-05-16 14:22:02,750 ERROR [org.jboss.as.server] (management-handler-thread - 2) WFLYSRV0021: Deploy of deployment "app.war" was rolled back with the following failure message: "WFLYCTL0344: Operation timed out awaiting service container stability"
2017-05-16 14:22:07,751 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 2) WFLYCTL0190: Step handler org.jboss.as.server.deployment.DeploymentHandlerUtil$1@1a67560 for operation {"operation" => "deploy","address" => {"deployment" => "app.war"},"operation-headers" => {"caller-type" => "user","access-mechanism" => "NATIVE"}} at address [("deployment" => "app.war")] failed handling operation rollback -- java.util.concurrent.TimeoutException: java.util.concurrent.TimeoutException
at org.jboss.as.controller.OperationContextImpl.waitForRemovals(OperationContextImpl.java:396)
at org.jboss.as.controller.AbstractOperationContext$Step.handleResult(AbstractOperationContext.java:1384)
at org.jboss.as.controller.AbstractOperationContext$Step.finalizeInternal(AbstractOperationContext.java:1332)
at org.jboss.as.controller.AbstractOperationContext$Step.finalizeStep(AbstractOperationContext.java:1292)
Post this the container gets to instable state and only works post the restart of application server itself.
Any help or reference guides would really help us. Thanks in advance.
./Arun