The Talon Manual

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 22 Next »

The platform's solace binding includes both a java based and jni based implementation and allows connectivity to a solace message router.

JNI vs JAVA Binding

The Java binding uses solace's JCSMP api while the JNI binding uses solace's CCSMP api. The JNI binding supports zero garbage messaging while in steady state, but only works on linux platforms. The Java binding is not zero garbage but works on all platform supported by X. Other differences between the two bindings are:

  • UnhandledMesssageEvents issued by the JNI binding return the subscription name rather than the sent topic name.
  • UnhandledMesssageEvents issued by the JNI binding return a session specific sequence number rather than the appliance wide sequence number in the transport specific message id. 
  • The provider properties passed through to the underlying property differ depending on the underlying solace library used. 
    (warning) The binding rationalizes some of the common properties between the two implementations, but if properties are used that are specific to JCSMP or JNI and are not rationalized, it is important to consider whether JNI is enabled or not. 

The JNI binding is currently only available on Linux platforms. Usage of the JNI binding is controlled by the following properties:

PropertyDefaultDescription
usejni-When set to true mandates that JNI be used. If JNI is not available an exception is thrown and binding creation fails. When set to false JNI is not used even if available.
preferjnitrue

Unlike usejni which forces usage one way or another, when preferjni=true the binding will silently fall back to using JCSMP when JNI is not available. When false the binding will not use JNI even if available.

As of 3.12, this property is ignored if a value for usejni is provided, in prior releases preferjni is used if usejni is not present or is set to false

SINCE 3.10

 

Bus Descriptor Format

A solace message bus can be configured via a descriptor string as follows which takes the connection information followed by a list of provider properties. 

solace://<address>:<port>&prop1=val1&propN=valN

An example bus descriptor for solace would like like:

solace://<address>:<port>&usejni=true&vpn_name=default&username=test& /
password=test&usejni=true&vpn_name=default&username=test&password=test

DDL

In a DDL config file a solace bus can equivalently be configured in one two ways

Decomposed
As A Descriptor

The descriptor form is useful in cases where the descriptor name may be supplied as an external configuration property that is substituted for example:

As A Descriptor

Solace Provider Properties

Passed Through Properties

The solace JCSMP and JNI apis on which the platform's solace binding is built allow configuration of the connection by specifying properties.  The provider properties specified in the bus descriptor for the binding are passed through to the solace connection as follows:

  • Properties that are not described as in the SolaceBindingProperties javadoc are stripped out. 
  • General Bus properties defined in  MessageBusDescriptor javadoc are also stripped out.

  • Properties listed as 'Rationalized Properties' below are translated according to whether the jni or java binding implementation will be used these.
  • If "usejni" is true, then any remaining properties that don't start with "FLOW_" or "SESSION_" are are stripped, the rest are passed through opaquely.
  • If "usejni" is false, then any remaining properties that don't start with "jcsmp" are are stripped, the rest are passed through opaquely.

See the solace documentation for more information on JCSMP and CCSMP. Neeve, does not test properties not explicitly called out on this page or in the javadoc. End users should therefore do their own due diligence in testing any passed through properties. 

Rationalized Pass Through Properties

To make is easier for applications to switch between using the jni (c) and jcsmp (java) binding implementations, several commonly used pass through binding properties are automatically translated by the binding. These are summarized in the table below. If your application doesn't use any additional solace configuration properties then switching between the java a c

Binding PropertyJCSMP PropertyCCSMP Property
"vpn_name""jcsmp.vpn_name""SESSION_VPN_NAME"
"username""jcsmp.usename""SESSION_USERNAME"
"password""jcsmp.password""SESSION_PASSWORD"
"publish_window_size""jcsmp.pub_ack_window_size""SESSION_PUB_WINDOW_SIZE"
"reconnect_retry_count""jcsmp.CLIENT_CHANNEL_PROPERTIES.ReconnectRetries""SESSION_RECONNECT_RETRIES"
"connect_retry_count""jcsmp.CLIENT_CHANNEL_PROPERTIES.ConnectRetries""SESSION_CONNECT_RETRIES"
"tcp_nodelay""jcsmp.CLIENT_CHANNEL_PROPERTIES.tcpNoDelay""SESSION_TCP_NODELAY"
"reapply_subscriptions""jcsmp.REAPPLY_SUBSCRIPTIONS""SESSION_REAPPLY_SUBSCRIPTIONS"
"ignore_subscriptions_error""jcsmp.IGNORE_DUPLICATE_SUBSCRIPTION_ERROR""SESSION_IGNORE_DUP_SUBSCRIPTION_ERROR"

MessageBusDescriptor.PROPNAME_ADDRESS

(the value from the bus descriptor address)

"jcsmp.HOST""SESSION_HOST"

Additional Properties

See the SolaceBindingProperties javadoc for the full of binding properties that can be used to configure the solace binding, those not called out as rationalized properties control the binding itself. 

Auto Tuning

When not explicitly as binding property, the following properties are automatically set on the binding based on the global optimization value.

Working with the Solace Binding

Solace Topic Format

Solace topics can be specified hierarchically with each level in the topic separated by a '/' character. Solace topics cannot exceed 250 characters in length. For more details on Solace topics refer to solace documentation.

Wildcard Topics

Solace supports 2 wildcard character sequences that can be used in Channel Filters to match multiple sending topics. Wildcard characters are not applied to sent topics and are treated as character literals. The solace binding implementation is sensitive to the following wildcards when nv.sma.cleanchannelfilter=true and will preserve these characters rather than replace them with an '_':

Wildcard
Description
*

Matches 0 or more characters and can only be used at the end of a topic level

For example orders/gin*

would match sends to

  • orders/gin
  • orders/ginseng

But not

  • orders
  • orders/in
  • orders/gin/foo
>

Matches multiple topic levels and may only be used as the only character last level in a topic filter strings

For example orders/>

would match sends to

  • orders/events/MSFT
  • orders/updates/APPL
  • orders/cancels/US/IBM

But not

  • orders
  • order-updates

 

Example

In the following example Solace messaging is configured with a dynamic channel key to resolve topics for new orders in a trading application. The variable portions of the dynamic key are used to allow receiving applications to select which traffic they shall receive: 

In the above example, the order-manager application uses a channel filter of  <filter>Region="US";Symbol=A*|MSFT</filter> which results in it creating the following subscriptions:

  • */US/A*
  • */US/MSFT*

In other words, it selects messages from any InitiatingClient in the 'US' region for the symbol MSFT or any Symbol starting with an 'A'. The order-manager app would receive the following message sent from a client with the following content:

But the order-manager would not receive messages sent from a client with the following content:

Message Metadata Version

When a message is sent through the solace binding SMA metadata is sent with the message to assist receivers in determining how to deserialize and dispatch the message. By default the solace binding sends messages using the V1 version of metadata to ensure that older receivers (pre Talon 1.8.396) can deserialize messages. The difference between the V1 and V2 metadata is that the V2 encodes the message type (prior to the introduction of V2 metadata receivers needed to introspect the serialized message content and use the xRogType field encoded in the message).

If you know that there will be no downstream receivers using a version prior to 1.8.396, you can set sma_metadata_version=2 as a solace binding property to use the newer metadata format which is more efficient.

 

 

Orphan Subscription Checks

When a solace message bus binding has a queue name specified it is capable of issue guaranteed subscriptions against that queue. When a binding is started it is possible that there may already be existing subscriptions on the queue that don't match those that the application is issuing. Such subscriptions are considered to be 'orphan' subscriptions - presumably those left over from an early session that were not removed.

The following policy can be configured to check for orphan subscriptions

 Policy Desecription
None

With this policy, the appliance is not queried for subscriptions

This is the default policy

Ignore

With this policy enabled the appliance is queried for subscriptions, but no action is taken other than tracing the orphans subscriptions at info level.

One other difference between SolaceOrphanSubscriptionCheckPolicy.None and SolaceOrphanSubscriptionCheckPolicy.Ignore is the the query subscriptions are reported to a subscription validator if registered. 

LogExceptionAndContinue

With this policy enabled the appliance is queried for subscriptions and if orphands are found an exception is logged.

NoOrphan

With this policy enabled the appliance is queried for subscriptions and an exception is thrown from the message binding start method.

Configuration

To check for existing subscription SEMP must be enabled for the binding to retrieve the list of subscriptions over the messaging connection. The following provider properties must be specified on the bus descriptor to perform subscription checks:

PropertyUsageDefaultDescription
enable_sempoptionalfalse

Property controlling whether or not Solace semp over messaging requests are enabled.

Controls whether or not semp over messaging requests are enabled. This property must be enabled in order to query the solace appliance for existing subscriptions. This requires that the appliance has semp over messaging enabled and that the user is authorized to make semp requests.

(warning) NOTE: SEMP operations are currently an experimental feature. Enabling semp is not recommended in production without rigorous end user testing, and it should be noted that solace could drop support for SEMP over messaging in the future. Reliance on SEMP operations may also limit ability to connect to solace appliance versions that don't have a compatibles SEMP model.

orphan_subscription_checkoptionalNone

Property controlling the orphan subscription check policy.

This policy controls checks for orphaned Guaranteed subscriptions done when the solace binding is started. The check for orphaned is performed after the bindings subscription are created, but just before messaging is started. The solace appliance is queried for the list of Guaranteed subscriptions on the Queue and compared to the subscriptions that were issued. Any subscriptions on the queue that were not issued by the binding are deemed to be orphans.

When using a policy other than None , "enable_semp" must be set to true. 

semp_versionrecommendedsoltr/7_1_1The version of semp requests must match that supported by the messaging appliance. If this property is not set semp requests will be retried using the version reported in the error response if a version mismatch is detected. Setting this property correctly avoids the need to make the initial request to determine the semp version.
semp_request_timeoutrecommended10000

Property controlling what timeout to use for semp requests in milliseconds.

It is recommended that you test against your appliance and application under load to ensure that the default timeout of 10 seconds is sufficient.

subscription_validatorunsupported-This is a legacy property that allows the an application registered callback to perform additional subscription validation. This should only be used on guidance for Neeve support.

Enforcing Max Queue Bind Count

When using solace with Guaranteed messaging, a queue to hold messages for the application must be provisioned to provide the required store and forward capabilities. When using a queue it is recommended that the queue be provisioned with a max bind count of 1, to ensure that only one instance of an applcation can bind to the queue. This provides an extra level of protection against network partitioning between a primary and backup member by ensure that 2 instances can't both consume messages. As an extra check that the queue has been provisioned with a max bind count of 1 the binding can be configured to make a SEMP call to enforce the expected bind count and cause the bus binding startup to fail. The configuration properties below can be set to allow this:
SINCE 3.8
PropertyUsageDefaultDescription
enable_sempoptionalfalse

Property controlling whether or not Solace semp over messaging requests are enabled.

Controls whether or not semp over messaging requests are enabled. This property must be enabled in order to query the solace appliance for existing subscriptions. This requires that the appliance has semp over messaging enabled and that the user is authorized to make semp requests.

(warning) NOTE: SEMP operations are currently an experimental feature. Enabling semp is not recommended in production without rigorous end user testing, and it should be noted that solace could drop support for SEMP over messaging in the future. Reliance on SEMP operations may also limit ability to connect to solace appliance versions that don't have a compatibles SEMP model.

enforce_max_bind_countoptional0

Can be set to a positive value to enforce match against a provisioned queue's max bind count.

When set the binding will issue a SEMP request when the binding is started to check that the max bind count for the provisioned queue matches the value of this property. This can be used to ensure that exclusive connectivity to the queue when it is provisioned with a max bind count of 1, to disallow 2 application instances for concurrently connecting to a queue.

This property is ignored if the binding is not configured with a queue or if the value of the property is less than or equal to 0.

(warning) NOTE:Setting this property to a positive value requires that SEMP is enabled and available because the max bind count for the provisioned queue is retrieved via a SEMP request. If the SEMP is disabled, SEMP requests cannot be issued or the response is invalid the binding will fail to open when this property is specified and set to a positive value.

Sending and Receiving from External Applications

This section describes how to send to Talon applications from non Talon applications and from Talon application to non Talon applications over solace. This is an uncommon usecase ... see Sending and Receiving Messages for information on sending from within a Talon application. The sections below utilize the ADM generated messages for convenience, but this is not required. For example, if you your messages are encoded in protobuf (or Xbuf) you could encode/decode the message yourself without using ADM. One such example of this might be if you were using C and generated protobuf message from the IDL generated by ADM. 

Sending Messages

The platform's Solace binding transports encoded messages in a BytesMessage. The encoded messages is set as the message data, and the metadata is stored as serialized MessageMetadata in the "x-sma-metadata" property. The example below shows how an external application can send a message natively using the solace JCSMP client:

Receiving Messages

The following code sample shows how an external application using the Solace JCSMP api directly can unpack a message sent over the platform's built in Solace binding and materialize it into a message view. 

  • No labels