1 Reply Latest reply on Mar 13, 2019 2:54 AM by gregoan

    Batch script

    gregoan

      Hi,

       

      We are using the standalone.xml configuration.

      We have to configure the JMS layer (standalone-full.xml is not a option) so we built a set of CLI command which are working fine (jboss-cli.sh) :

       

      batch

       

      /extension=org.wildfly.extension.messaging-activemq:add

      run-batch

       

      # Configure JMS layer (add activemq)

      batch

      /subsystem=messaging-activemq:add

      run-batch

      :reload

       

      batch

      /subsystem=messaging-activemq/server=default:add

      run-batch

       

      batch

      /subsystem=messaging-activemq/server=default/security-setting=\#:add

      /subsystem=messaging-activemq/server=default/address-setting=\#:add(dead-letter-address="jms.queue.DLQ", expiry-address="jms.queue.ExpiryQueue", expiry-delay=1L, max-delivery-attempts="10", max-size-bytes="10485760", page-size-bytes="2097152", message-counter-history-day-limit="10")

      /subsystem=messaging-activemq/server=default/http-connector=http-connector:add(socket-binding="http", endpoint="http-acceptor")

      /subsystem=messaging-activemq/server=default/http-connector=http-connector-throughput:add(socket-binding="http", endpoint="http-acceptor-throughput" ,params={batch-delay="50"})

      /subsystem=messaging-activemq/server=default/in-vm-connector=in-vm:add(server-id="0")

      /subsystem=messaging-activemq/server=default/http-acceptor=http-acceptor:add(http-listener="default")

      /subsystem=messaging-activemq/server=default/http-acceptor=http-acceptor-throughput:add(http-listener="default", params={batch-delay="50", direct-deliver="false"})

      /subsystem=messaging-activemq/server=default/in-vm-acceptor=in-vm:add(server-id="0")

      run-batch

      :reload

       

      # Create the ConnectionFactory

      batch

      /subsystem=messaging-activemq/server=default/connection-factory=ConnectionFactoryLocal:add(connectors=["in-vm"], entries=["java:/jms/ConnectionFactoryLocal"])

       

      # Create the JMS queue

      #jms-queue add --queue-address=gregoanQueueLocal --entries=jms/queue/gregoanQueueLocal

      /subsystem=messaging-activemq/server=default/jms-queue=gregoanQueueLocal:add(entries=["java:/jms/queue/gregoanQueueLocal"])

      run-batch

      :reload

       

      When we are executing these command in one unique CLI file in a scope of multiple CLI files execution, we have the following error :

       

      => Executing cli files

      Launching JBoss CLI script [/opt/jboss/wildfly/customization/jms.cli] with properties file

      The batch executed successfully

      The batch executed successfully

      process-state: reload-required

      {

          "outcome" => "success",

          "result" => undefined

      }

      The batch failed with the following error (you are remaining in the batch editing mode to have a chance to correct the error): Failed to perform operation: java.util.concurrent.CancellationException: JBTHR00004: Operation was cancelled

      => Shutting down WildFly

      {

          "outcome" => "success",

          "result" => undefined

      }

       

      I thought it was due to the fact a huge set of command were part of the same CLI file so I even tried to split it in many without any difference :

       

      b_jms.cli_

      batch

       

      /extension=org.wildfly.extension.messaging-activemq:add

       

      run-batch

      :reload

       

      c_jms.cli_

      batch

       

      # Configure JMS layer (add activemq)

      /subsystem=messaging-activemq:add

       

      run-batch

      :reload

       

      d_jms.cli_

      batch

       

      /subsystem=messaging-activemq/server=default/security-setting=\#:add

      /subsystem=messaging-activemq/server=default/address-setting=\#:add(dead-letter-address="jms.queue.DLQ", expiry-address="jms.queue.ExpiryQueue", expiry-delay=1L, max-delivery-attempts="10", max-size-bytes="10485760", page-size-bytes="2097152", message-counter-history-day-limit="10")

      /subsystem=messaging-activemq/server=default/http-connector=http-connector:add(socket-binding="http", endpoint="http-acceptor")

      /subsystem=messaging-activemq/server=default/http-connector=http-connector-throughput:add(socket-binding="http", endpoint="http-acceptor-throughput" ,params={batch-delay="50"})

      /subsystem=messaging-activemq/server=default/in-vm-connector=in-vm:add(server-id="0")

      /subsystem=messaging-activemq/server=default/http-acceptor=http-acceptor:add(http-listener="default")

      /subsystem=messaging-activemq/server=default/http-acceptor=http-acceptor-throughput:add(http-listener="default", params={batch-delay="50", direct-deliver="false"})

      /subsystem=messaging-activemq/server=default/in-vm-acceptor=in-vm:add(server-id="0")

       

      run-batch

      :reload

       

      e_jms.cli_

      batch

       

      # Create the ConnectionFactory

      /subsystem=messaging-activemq/server=default/connection-factory=ConnectionFactoryLocal:add(connectors=["in-vm"], entries=["java:/jms/ConnectionFactoryLocal"])

       

      # Create the JMS queue

      #jms-queue add --queue-address=gregoanQueueLocal --entries=jms/queue/gregoanQueueLocal

      /subsystem=messaging-activemq/server=default/jms-queue=gregoanQueueLocal:add(entries=["java:/jms/queue/gregoanQueueLocal"])

       

      run-batch

      :reload

       

      The script "d_jms.cli_" is failing :

       

      => Executing cli files

       

      Launching JBoss CLI script [/opt/jboss/wildfly/customization/b_jms.cli] with properties file

      The batch executed successfully

      {

          "outcome" => "success",

          "result" => undefined

      }

       

      Launching JBoss CLI script [/opt/jboss/wildfly/customization/c_jms.cli] with properties file

      The batch executed successfully

      process-state: reload-required

      {

          "outcome" => "success",

          "result" => undefined

      }

       

      Launching JBoss CLI script [/opt/jboss/wildfly/customization/d_jms.cli] with properties file

      The batch failed with the following error (you are remaining in the batch editing mode to have a chance to correct the error):

      WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:

      Step: step-1

      Operation: /subsystem=messaging-activemq/server=default/security-setting=#:add

      Failure: WFLYCTL0175: Resource [

          ("subsystem" => "messaging-activemq"),

          ("server" => "default")

      ] does not exist; a resource at address [

          ("subsystem" => "messaging-activemq"),

          ("server" => "default"),

          ("security-setting" => "#")

      ] cannot be created until all ancestor resources have been added

       

      I have also restarted the server between each CLI file execution : same behavior ...

      Did I miss anything ?

       

      Regards,

      GREGOIRE Alain.

        • 1. Re: Batch script
          gregoan

          "We have to configure the JMS layer (standalone-full.xml is not a option) so we built a set of CLI command which are working fine (jboss-cli.sh)"

           

          What I meant with execution of CLI file is I executed manually each commands (one by one)
          If I'm launching them in one shoot, I have the same issue so it looks like a timing execution issue.