Example Commands

The following are example SDKPerf command lines with brief descriptions of the test performed. The goal of this section is to make it easier to determine how to build your own SDKPerf command lines through examples. All of the examples assume the following:

  • You want to connect to the Message VPN named default.
  • You have authentication disabled in that Message VPN.
  • You have the client username named default enabled in your Message VPN.

Note:  By default, a Solace VMR meets these requirements.

In all of these commands replace <<HOST>> with the host or IP of your Solace message router. The following examples also favor using sdkperf_java, but the command line options will work equally with other versions of SDKPerf as outlined in the “Applicability” notes.

Publish/Subscribe with Direct Messages

Publish and receive five messages of 100 bytes in size on a topic of T/a at 1 msg/sec:

sdkperf_java -cip=HOST -ptl=T/a -stl=T/a -msa=100 -mn=5 -mr=1

For Solace REST messaging, the concept is similar except that the subscribe topics are provisioned on the REST delivery point queue. See Tool Dependencies for details on required Solace message router configuration for this to work. In Solace REST messaging, add topic T/a to the REST delivery point queue and have the REST consumers connect to port 8081, and then the command is simply:

sdkperf_rest -cip=HOST -spl=8081 -ptl=T/a -mt=persistent -msa=100 -mn=1 -mr=1

Applicability:

  • Supported in all SDKPerf versions

Point to Point with Guaranteed Messaging

Assuming a pre-existing durable queue of Q/demo, bind to this queue, send a 100 byte persistent message, and receive it.

sdkperf_java -cip=HOST -pql=Q/demo -sql=Q/demo -mt=persistent -msa=100 -mn=1 -mr=1

For REST, the concept is similar except that the REST delivery point queue is a pre-configured queue. So make sure the –pql argument is the name of the REST deliver point queue.

sdkperf_rest -cip=HOST -spl=8081 -pql=Q/rdp -mt=persistent -msa=100 -mn=1 -mr=1

Applicability:

  • Supported in SDKPerf C#, Java, JMS, REST
  • Unsupported in SDKPerf JavaScript, MQTT

Publish/Subscribe with Guaranteed Messaging

In general, Solace APIs support pub/sub by either using a queue with topic subscriptions that are mapped to it or by using a topic endpoint. This example uses a temporary topic endpoint.

sdkperf_java -cip=HOST -ptl=T/demo -stl=T/demo -mt=persistent –tte=1 -msa=100 -mn=1 -mr=1

For MQTT, the concept is the same, but the way you express the Guaranteed Messaging changes. Instead of -mt and -tte, you use -mpq and -msq to specify the MQTT QoS for the messages.

sdkperf_mqtt -cip=HOST -ptl=T/demo -stl=T/demo -mpq=1 -msq=1 -msa=100 -mn=1 -mr=1

For Solace REST messaging, the concept is again similar except that the topic subscriptions are provisioned on the REST delivery point queue. So the command is simply:

sdkperf_rest -cip=HOST -spl=8081 -ptl=T/demo -mt=persistent -msa=100 -mn=1 -mr=1

Applicability:

  • Supported in SDKPerf C, C#, Java, JMS, MQTT
  • Unsupported in SDKPerf JavaScript

Provision a Queue and Map Topics

Provision a queue through -pe and then map two topic subscriptions to this queue. Finally, publish 100 persistent messages to the topics to validate message flow. The provisioned queue is also cleaned up by the tool at the end of the execution.

sdkperf_java -cip=HOST -pe -sql=queue -stl=a,b -ptl=a,b -mt=persistent -mn=100 -mr=100 -msa=100

Applicability:

  • Supported in SDKPerf C, C#, Java
  • Unsupported in SDKPerf JavaScript, JMS, MQTT, REST

Subscribe with Deliver Always

Subscribe to topic T/a with deliver always flag. Useful in testing publish to one (-pto).

sdkperf_java -cip=HOST -stl="T/a<TOPIC_END/>DA=1"

Applicability:

  • Supported in SDKPerf C, C#, Java, JavaScript
  • Unsupported in SDKPerf JMS, REST, MQTT

Publish Persistent Messages with TTL- and DMQ-Eligible

Publish a persistent message to a queue with time-to-live of 1000 milliseconds, and mark the message as DMQ-eligible.

sdkperf_java -cip=HOST -pql=queue -mt=persistent -mn=1 -mr=1 -msa=100 -mtl=1000 –mdq

Applicability:

  • Supported in SDKPerf C, C#, Java, JMS, REST
  • Unsupported in SDKPerf JavaScript, MQTT

Publish/Subscribe to Persistent Messages with Selectors and Structured Data

Publish a persistent message containing structured data to a queue.

sdkperf_c -cip=HOST -pql=queue -mt=persistent -mn=1 -mr=1 –sdm=sdm1.txt

Where the contents of sdm1.txt are:

msg: type=map
msg: useBinaryAttachment=0
bool   name=a value=0
uint16 name=b value=3
int16  name=c value=4
uint32 name=d value=5
int32  name=e value=6
uint64 name=f value=7
int64  name=g value=8
string name=h value=matchTopic
float  name=i value=1.2345678
double name=j value=2.3456789

Applicability of -sdm argument as used in the above example:

  • Supported in SDKPerf C
  • Unsupported in SDKPerf C#, Java, JMS, JavaScript, REST, MQTT

Subscribe to the queue using a selector to allow only messages matching specific criteria:

sdkperf_java -cip=HOST -sql=queue –ssl=“c>2 AND h=‘matchTopic’”

Applicability of -ssl argument to add selectors:

  • Supported in SDKPerf C, C#, Java, JMS
  • Unsupported in SDKPerf JavaScript, REST, MQTT

Advanced Testing Commands

The following are example SDKPerf command lines for advanced testing.

Measure Latency

There are several options that can control latency measurement within SDKPerf. See Performance and Latency Measurement for the list of options. The following is a simple example that enables latency measurement and sets the warmup period to one second.

sdkperf_java -cip=HOST -ptl=T/a -stl=T/a -mn=5 -msa=100 -mr=1 -l -lwu=1

When you add this, you get additional output similar to the following:

Latency Info:
Latency Info:
Individual latency bucket size = 1.0 us
Latency warmup                 = 1.0s
Latency Messages received      = 1000000
Latency msg rate (msg/sec)     = 10000

Latency Stats:
Minimum latency for subs       = 27
Average latency for subs       = 34
50th percentile latency        = 35
95th percentile latency        = 39
99th percentile latency        = 39
99.9th percentile latency      = 40
Maximum latency for subs       = 41
Standard Deviation             = 2.3

Check Message Order

SDKPerfcan check the order of all messages sent and received by embedding a unique ID within each message sent. This is enabled using the option -oc.

sdkperf_java -cip=HOST -ptl=T/a -stl=T/a -mn=5 -msa=100 -mr=1 -oc

When order checking is enabled, SDKPerf will print extra stats similar to the following which summarizes the order checking:

Message Order Check Summary:
Total Msgs Order Checked : 5
Total Out of Order Msgs : 0
Total Missing Msgs : 0 Total Duplicate Msgs : 0
Total Redelivered Msgs : 0 Total Redelivered Duplicate Msgs: 0 Total Republished Duplicate Msgs: 0

Check Message Integrity

SDKPerf can check the integrity of all message contents sent and received by embedding a CRC hash within the transmitted message. This is enabled using the option -crc.

sdkperf_java -cip=HOST -ptl=T/a -stl=T/a -mn=5 -msa=100 -mr=1 -crc

When integrity checking is enabled, SDKPerf will print extra stats similar to the following, which summarizes the results:

Message Integrity Checking:
Total Messages with OK          = 5
Total Messages with ERRORS      = 0
Msgs with xml payload OK        = 0
Msgs with xml payload ERRORS    = 0
Msgs with attachment OK         = 5
Msgs with attachment ERRORS     = 0
Msgs with userdata OK           = 0
Msgs with userdata ERRORS       = 0
Msgs with stuctured data OK     = 0
Msgs with stuctured data ERRORS = 0