Send Command
Command Purpose
The send
command is used to send specific events to services on the JSLEE
cluster.
Command Syntax
The send
command has one form with flexible input:
send <destination> <message type> [global flags and/or [message flags or JSON]]
No output is returned from this command unless an error is encountered or a reply is expected.
Mandatory Parameter: destination
The destination
parameter is the JSLEE address to send the message to. This
should be in the format:
[node]:<service>:[endpoint]
Colons are only required for separation if the parameters on either side are given.
Mandatory Parameter: message type
The message type
parameter specifies the type (as a a case-insensitive alias)
of JSLEE message that should be constructed to send within a containing event.
The supported aliases are:
Type | Container | Aliases |
---|---|---|
SMPP submit_sm |
SMPPMessageEvent |
submit_sm ,submitsm |
SMPP deliver_sm |
SMPPMessageEvent |
deliver_sm ,deliversm |
Internal event | NotificationMessageEvent |
notification |
Optional Parameter: global flags
By default, messages are sent:
- Without waiting for a reply, and
- To only a single matching destination.
Some optional flags are available for all message types to control the manner in which the message is sent:
Flag | Description |
---|---|
-p |
Send message promiscuously, i.e. to all matching destinations. Mutually exclusive with -r . |
-r |
Wait for response to message. Mutually exclusive with -p . |
Optional Parameter: event flags
/ JSON
Each message type may allow additional parameters to be sent to provide message data. These parameters may be either sent as:
- Unix-style short or long flags, e.g.
send smpp submit_sm -s 123 -destination 456
- A JSON string, e.g.
send smpp submit_sm "s:123,d:456"
The two parameter styles are mutually exclusive, and only one style can be used, e.g. if JSON is provided then no message-specific flags can be specified. Global flags may still be used in either case.
Note that the JSON format supported is “Relaxed JSON”, which allows for ease-of-use features such as unquoted identifiers. Refer to the Relaxed JSON site for further details. Strict JSON is also supported.
All identifiers used for message-specific flags are identical regardless of the input format; the alternate formats are provided for convenience only.
Message Parameters: submit_sm
/ deliver_sm
Identifier(s) | Required? | Default | Description |
---|---|---|---|
s ,sender ,source_addr |
Yes | - | The alphanumeric message sender. |
d ,destination ,destination_addr |
Yes | - | The alphanumeric message destination. |
m ,message |
No | null |
The message body. Must be enclosed in quotes if it contains spaces. |
Note that the message
parameter is always encoded using the ASCII SMPP encoding scheme.
Message Parameters: notification
Identifier(s) | Required? | Default | Description |
---|---|---|---|
t ,type |
Yes | - | The (application-specific) type of message. |
s ,subtype |
Yes | - | The (application-specific) message subtype. |
b ,body |
No | (blank) | The message body. Must be a valid JSON or RSJON string. |
r ,source |
No | null |
The source of the notification. |
i ,id ,primary |
No | null |
The ID of the primary object the notification concerns. |
e ,secondary |
No | null |
The ID of the secondary object the notification concerns. |
Error Messages
Invalid Syntax
ERROR: destination and message type must be supplied.
The send
command requires an address and message type to be passed to it.
ERROR: The flags 'promiscuous send' and 'wait for reply' are mutually exclusive.
The send
command cannot both wait for a reply and also perform a promiscuous
send. Only one or none of these options is allowed.
ERROR: The message type '<message type>' does not support being sent via command.
The message type given is not recognised or does not support command-line invocation.
ERROR: Invalid syntax: <details>
The supplied message-specific parameters are not valid due to the reasons given.
Command Failure
ERROR: Message was not sent successfully: <details>
The message was not sent successfully due to the reasons given. Ensure the destination is valid. Contact N-Squared technical support if problems persist.
ERROR: Unable to construct request: <details>
The message was not constructed successfully due to the reasons given. Ensure the destination is valid. Contact N-Squared technical support if problems persist.