4 Replies Latest reply on Sep 6, 2013 5:58 AM by aloubyansky

    jboss-cli output irritating

    lafr

      I'm using the following cli script to add mail config to WildFly server:

      if (outcome != success) of /socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=mail-smtp:read-resource

          /socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=mail-smtp:add(host="smtp.1und1.de",port="25")

      end-if

      if (outcome != success) of /socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=mail-imap:read-resource

          /socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=mail-imap:add(host="imap.1und1.de",port="143")

      end-if

      if (outcome != success) of /subsystem=mail/mail-session="java:/Mail":read-resource

          /subsystem=mail/mail-session="java:/Mail":add(jndi-name=java:/Mail,from="name@domain.de",debug=false)

          /subsystem=mail/mail-session="java:/Mail"/server=smtp:add(outbound-socket-binding-ref=mail-smtp,ssl=false,username="...",password="...")

          /subsystem=mail/mail-session="java:/Mail"/server=imap:add(outbound-socket-binding-ref=mail-imap,ssl=false,username="...",password="...")

      end-if

       

      The output for the first execution when entries are added is like this:

      #1 /socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=mail-smtp:add(host="smtp.1und1.de",port="25")

      #1 /socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=mail-imap:add(host="imap.1und1.de",port="143")

      #1 /subsystem=mail/mail-session=java:/Mail:/Mail":add(jndi-name=java:/Mail,from="name@domain.de",debug=false)

      #2 /subsystem=mail/mail-session=java:/Mail/server=smtp:/Mail"/server=smtp:add(outbound-socket-binding-ref=mail-smtp,ssl=false,username="...",password="...")

      #3 /subsystem=mail/mail-session=java:/Mail/server=imap:/Mail"/server=imap:add(outbound-socket-binding-ref=mail-imap,ssl=false,username="...",password="...")

       

      Executing the same script again gives the same output:

      #1 /socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=mail-smtp:add(host="smtp.1und1.de",port="25")

      #1 /socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=mail-imap:add(host="imap.1und1.de",port="143")

      #1 /subsystem=mail/mail-session=java:/Mail:/Mail":add(jndi-name=java:/Mail,from="name@domain.de",debug=false)

      #2 /subsystem=mail/mail-session=java:/Mail/server=smtp:/Mail"/server=smtp:add(outbound-socket-binding-ref=mail-smtp,ssl=false,username="...",password="...")

      #3 /subsystem=mail/mail-session=java:/Mail/server=imap:/Mail"/server=imap:add(outbound-socket-binding-ref=mail-imap,ssl=false,username="...",password="...")

      Although this time nothing is added to the configuration. Everything is there already and outcome == success and the add commands are not executed.

       

      Why?

      Any option available to change this?

      If not, worth a feature request?

        • 1. Re: jboss-cli output irritating
          jaikiran

          Which exact version of WildFly is this? Do you remember if this is a recent behaviour or have you been seeing this always?

          • 2. Re: jboss-cli output irritating
            lafr

            WildFly-8.0.0.Beta1-SNAPSHOT, build from sources at github.com.

            I checked the behavior with JBoss-AS 7.20. Same output.

            So this is nothing new, always been the case.

            That's why I asked about feature request and not a bug.

            • 3. Re: jboss-cli output irritating
              jaikiran

              I don't have enough knowledge of how CLI deals with this, but to me this looks more like a bug than a feature request. I don't see a reason why those operations are being printed out if they aren't being executed. I'll see if Alexey would be able to take a look at this thread.

              • 4. Re: jboss-cli output irritating
                aloubyansky

                It comes from batch processing. When a new command/operation is added to a batch, its number and the command itself is logged. Since the bodies of if-else conditions are treated as batches, the commands are logged this way. It doesn't mean they are executed. But I understand why it's looking confusing... It should be reviewed.