FAQ: Configuring Forum Sentry Solace Compression via JNDI

This article is applicable to Forum Sentry deployments utilizing the Solace Network Policies.

There are two mechanisms for enabling compression in Solace. Both are described below. When working with Sentry, the second mechanism should be used - Data Connection. The JNDI Connection details are provided for reference.  

For more information on the Solace product please contact Solace Support

 

1. The JNDI Connection

This connection to the Solace router is used for JNDI lookups, including to look up a connection factory. The JNDI connection has its own settings, including for compression, independent of what is configured in the connection factory. To use compression for the JNDI connection you need to set a non-zero compression level and, if the Solace router is configured to use a compressed listen port other than its default 55003, you must also specify the correct compression port in the provider URL.

The compression level for the JNDI connection can be configured when creating the Initial Context, for example:

env.put(SupportedProperty.SOLACE_JMS_COMPRESSION_LEVEL, 9);

Alternately, the compression level for the JNDI connection can be configured in a jndi.properties file, for example:

Solace_JMS_CompressionLevel=9

An example provider URL string specifying a port is

smf://solacerouter:55003

 

2. Data Connection

Data connections are created from the connection factory. They use the settings, including for compression, specified in the connection factory.

To use compression for the data connection you must configure a non-zero value for the “compression-level” property in the connection factory. If the connection factory’s “port” property is left at its default value of -1, the data connection will use the same port as the JNDI connection.

Since the compressed and non-compressed list ports are different, if you want to use compression only for the data connection you must set the connection factory’s “port” property to the compressed listen port of the Solace router.

  • Verify what the compression listener port is on the Solace router. You can see the port in the output of the router’s ‘show service’ command. For example:

Flags Legend:
TP - Transport
S - SSL (Y=Yes, N=No, -=not-applicable)
C - Compressed (Y=Yes, N=No, -=not-applicable)
R - Routing Ctrl (Y=Yes, N=No, -=not-applicable)
VRF - VRF (Mgmt=management, MsgBB=msg-backbone)
A - Admin State (U=Up, D=Down, -=not-applicable)
O - Oper State (U=Up, D=Down, -=not-applicable)

Status
Service TP S C R VRF MsgVpn Port A O Failed Reason
-------- — ----- ----- --------------- ----- — ---------------------------
SEMP TCP N - - Mgmt 8080 U U
SEMP TCP Y - - Mgmt 943 U D No Cert
SMF TCP N N N Mgmt 55555 U U
SMF TCP N Y N Mgmt 55003 U U
SMF TCP N N Y Mgmt 55556 U U
SMF TCP Y N N Mgmt 55443 U D No Cert
SMF WEB N - - Mgmt 80 U U
SMF WEB Y - - Mgmt 443 U D No Cert
MQTT TCP N - - Mgmt default 1883 U U
MQTT TCP Y - - Mgmt default 8883 U D No Cert
MQTT WEB N - - Mgmt default 8000 U U
MQTT WEB Y - - Mgmt default 8443 U D No Cert
REST WEB N - - Mgmt default 9000 U U
REST WEB Y - - Mgmt default 9443 U D No Cert
REST WEB N - - Mgmt solace 0 D D Port not Assigned
REST WEB N - - Mgmt solace 0 D D Port not Assigned
MATELINK TCP N N N Mgmt 8741 D D

 

  • If you are using an early version of the VMR (pre 7.2), compression is not supported. You will need to upgrade to a later version.

 

  • To properly configure compression on the data connection the port and compression level need to be configured.

 

  • If the port is left as -1, the default, the data compression uses the same port as the JNDI connection.

 

  • The JNDI connection must be pointing to the uncompressed Solace port and the data connection configured in the connection factory must be pointing to the compressed port.

 

Editing the Connection Factory

There are two settings in the connection factory that need to be configured in order for compression to work between Sentry and Solace on the data connection. This is assuming you already have configured Sentry with Solace and can produce to and consume from queues.

 

First, Modify the Connection Factory in Solace:

_screen1.jpg

 

1. Set the compression to an integer value between 1 and 9

2. Set the Port to the compression port configured on the system. By default for Solace virtual machines, the port is enabled and set to 55003.

 

screen2.JPG

 

Additional Notes

 
Solace has two ports: one that uses compression and one that does not. The JMS API first connects to Solace to retrieve the connection factory and other information from the Solace directory through JNDI.
This connection can be compressed but Sentry does not expose a way to enable compression for this connection.
 
When configuring Sentry, the port used on the network policy must always be the uncompressed port.  Once the connection factory is retrieved, it is used to create JMS connections to Solace. The connection factory includes the settings required to connect to Solace.
 
By default, the connection does not use compression and the default port is -1. For Solace, when the connection factory port is configured to -1, it translates to use the same port used for the Solace JNDI connection.
 
To enable compression on the data connection, the connection used to send and receive messages, the connection factory must have a compression level enabled and the port must be configured to the compression port.
 
Possible problems:
  1. Configuring Sentry to connect using the compressed port. Since Sentry does not expose a way to compress the JNDI connection, this will result in a failure to find the connection factory. The uncompressed port must always be configured in Sentry and the connection factory must be configured to use the correct compression port.
  2. Configure a compression level at the connection factory but leave the port configured at -1. This will also result in a failure because Sentry will obtain the connection factory and attempt to use a compressed connection to the uncompressed port. 

 

Solace Reference Documentation 

Compression Level
http://docs.solace.com/Solace-JMS-API/JNDI-Connection-Properti.htm#jms_properties_39190069_333471

Using Message Compression
http://docs.solace.com/Configuring-and-Managing-Routers/Using-Message-Compresssion.htm

 

 

 

 

 

Have more questions? Submit a request

0 Comments

Article is closed for comments.