NEXUSe2e - comet

General Usage Notes

The purpose of this utility is to provide a simple way to send test messages to your NEXUSe2e instances.

Every parameter has a standard value which is taken from the default partner of a NEXUSe2e installation. These values will be used if the parameter is not delivered by the initial tool invocation. SSL will not work by default it is not enabled out of the box for the default partner - see below for further information.

If given no parameters at all, comet will show the parameter help, hence you will need to provide at least one parameter even if all defaults would work for your installation.

Acknowledgements and Messaging

Reliable Messaging

comet does not support reliable messaging yet and cannot accept acknowledgements NEXUSe2e sends in reply to a test message.

What does this mean for my test?
If reliable messaging is activated, an acknowledgement will be send to the connection configured for the used partner. In case of default partner "Xioma" it will be send to http://localhost:8080/NEXUSe2e by default. Be careful while testing with a custom partner configuration. NEXUSe2e could send an acknowledgement - generated by a message from comet - to a live or test system to the used partner.

Be careful while testing with an existing partner configured by your own, NEXUSe2e could send an acknowledgement - generated by a message from comet - to a live or test system to the used partner.

If you send test messages to a NEXUSe2e with reliable messaging enabled you'll find following log entries in your transaction log or tomcat log files.

These log entries are from a Tomcat with NEXUSe2e deployed.
    The message comet has send was successfully received by NEXUSe2e:

[INFO ] 2014-10-20 13:23:39,148 org.nexuse2e.messaging.FrontendInboundDispatcher.processMessage(FrontendInboundDispatcher.java:173) - d7a640e0-189b-40bc-a17b-0a4d0179d6ca/6cf986f3-dd87-4be5-a3fe-8300a29c31cc(GenericFile->SendFile): Received normal (6cf986f3-dd87-4be5-a3fe-8300a29c31cc) from Xioma for GenericFile/SendFile

    NEXUSe2e tries to send an acknowledgement to the connection of the configured partner:

[INFO ] 2014-10-20 13:23:39,220 org.nexuse2e.messaging.FrontendOutboundDispatcher.processMessage(FrontendOutboundDispatcher.java:65) - d7a640e0-189b-40bc-a17b-0a4d0179d6ca/6effb26a-6172-4f85-a8fc-f59496757f84 (GenericFile->SendFile): Sending Acknowledgement message (6effb26a-6172-4f85-a8fc-f59496757f84) to Xioma for GenericFile/SendFile

    The acknowledge couldn't be send because the connection didn't exist or wasn't reachable:

[WARN ] 2014-10-20 13:23:43,239 org.nexuse2e.service.http.HttpSenderService.sendMessage(HttpSenderService.java:302) - d7a640e0-189b-40bc-a17b-0a4d0179d6ca/6effb26a-6172-4f85-a8fc-f59496757f84 (GenericFile->SendFile): Message submission failed: java.net.Connect Exception: Connection refused: connect java.net.ConnectException: Connection refused: connect

Despite the warning or error messages in the log files, this test was a success as you can see in the first log entry shown. This NEXUSe2e instance was able to receive a message sent by comet.

Success Message from comet

If the message was send successfully - which does not necessarily mean it was processed by NEXUSe2e - it will look like this in your command line:

[DEBUG] 2014-10-20 14:13:13,038 org.nexuse2e.comet.ui.ClientWorker.post(ClientWorker.java:157) - HTTP/1.1 200 OK

Above this message you'll see the content related information.

Parameter description

-a,--action <Action> (Optional) Set Action Identity. Default: (SendFile)
-c,--choreography <Choreography>                          (Optional) Set Choreography Identity. Default: (GenericFile)
-f,--file <File> (Optional) Path of Payloadfile. comet ships with an internal payload for test purpose.
-h,--help Shows Parameter Description
-ha,--handler [ebxml20|httpplain] (Optional) Set Handler to use - ebXML2.0 and httpplain are supported. Default: (ebxml20)
-r,--receiver <Receiver> (Optional) Set NEXUSe2e Server Identity. Default: (localhost)
-p,--partner <Partner> (Optional) Set Remote Participant (comet) Identity. Default: (Xioma)
-u,--url <NEXUSe2e Server URL> (Optional) Set Server URL. Default: (http://localhost:8080/NEXUSe2e/)
   
Parameters especially used for SSL Messaging  
   
-kp,--keystorepassword <Keystorepassword> (Optional) Password for custom Keystorefile.
-ks,--keystore <Keystore> (Optional) Path to custom Keystorefile.
-tp,--truststorepassword <Truststorepassword> (Optional) Password to custom Truststorefile.
-ts,--truststore <Truststore> (Optional) Path to custom Truststorefile.
-dc,--displaycert (Optional) Will display the servers certificate chain. No Parameter needed.
-pw,--privatepassword Password for private key. Mandatory if custom keystore-file and displaycert is used.

Parameter Example

Provide NEXUSe2e URL only:

java -jar nexuse2e-comet-1.1.jar -u http://192.168.1.1:8080/NEXUSe2e/

If there are blanks in the directory path please add quotes to the string:

java -jar nexuse2e-comet-1.1.jar -f "c:\temp files\message.txt"

All important message parameters:

java -jar nexuse2e-comet-1.1.jar -p ExamplePartner -c genericChoreo -a sendAction -u http:\\192.168.2.1\ExampleNEXUSe2e\ -ha ebxml20 -f c:\temp\message.txt

SSL Messaging

If you want to test SSL messaging with the default certificates you need to import the nexuse2e_comet_public.cer for the partner in your NEXUSe2e instance
that you want to test with. You should also add the nexuse2e_server.jks to your Tomcat configuration file and enable a SSL connector.
The keystores will be loaded in comet despite using SSL or not, so you do not need any additional parameter. These inbuilt certificates are only meant for a rough test or playing around with the function.

To use your own keystore/truststore make sure they are delivered as jks format to comet.

Tomcat Server Config example for SSL Connector:

    <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
               maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
               clientAuth="true" sslProtocol="TLS"
               keystoreFile="C:\apache-tomcat\conf\nexuse2e_server.jks"
               keystorePass="nexuse2e" keystoreType="jks"
               truststoreFile="C:\apache-tomcat\conf\nexuse2e_server.jks"
               truststoreType="JKS" truststorePass="nexuse2e"
               />

Show Server Certificate Chain

If you want to verify the certification chain of your NEXUSe2e Tomcat server you can use comets -dc "displaycert" parameter. This parameter does not require an argument but needs the additional parameter -pw "Privatepassword" in case you use your own keystore-file.

Example:

java -jar nexuse2e-comet1.1.jar -u https://127.0.0.1:8443/Nexuse2e -ks "c:\myKestore.jks" -kp "myKestorePassword" -dc -pw "PrivateCertPassword"