Skip to main content

We currently use a JMS service that we connect to as a client, via some simple Java code (a Solace JMS service, that we are not the administrators of).

We are struggling to connect to the service using a JMSReceiver in FME Desktop. For simplicity, we have copied all of the relevant JAR files into the FME /plugins directory.

If we specify the Username in the transformer property, it is not recognized by the initial context factory (the context class returns a "Username must be specified" error). Instead, we have to use the "Additional Provider Properties" and specify:

java.naming.security.principal=myusername
java.naming.security.credentials=mypassword

Using my network traffic monitoring tool of choice (Wireshark), I can see the initial connection to the URL. However, the server returns a "The username or password is incorrect".

Questions:

  1. What is the JMSReceiver doing with the Username and Password fields?
  2. Is this the correct format for Additional Provider Properties? The documentation is not clear, and I cannot find any examples.

For reference, the working Java code we use is:

// Set the parameters for the initial context factory 
Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put(InitialContext.INITIAL_CONTEXT_FACTORY, myInitialContextFactoryClassName);
env.put(InitialContext.PROVIDER_URL, jndiProviderURL);
env.put(Context.SECURITY_PRINCIPAL, username);
env.put(Context.SECURITY_CREDENTIALS, password); 

InitialContext initialContext = null;
try {
    // This will connect and log into the provider URL
    initialContext = new InitialContext(env);
    // We did it!
    ....

 

Thanks in advance!

@neilhellas,

I've not seen this configured before in FME. It could be possible. We will need to take a look at this in a bit more detail.


@neilhellas,

I've not seen this configured before in FME. It could be possible. We will need to take a look at this in a bit more detail.

Are we using the correct format for Additional Provider Properties?


It turns out that "Additional Provider Properties" does not work the same as a jndi.properties file.

The resolution in this case was to:

  • Create a jndi.properties file, place this in the FME plugins directory.   The contents of this file should be 
java.naming.security.principal=myusername
java.naming.security.credentials=mypassword

 

Do NOT place anything in the transformer's username/password fields.   

Still looking for some documentation on what "Additional Provider Properties" does, and how they should be formatted.

Thanks to Steve for the assistance.

 


It turns out that "Additional Provider Properties" does not work the same as a jndi.properties file.

The resolution in this case was to:

  • Create a jndi.properties file, place this in the FME plugins directory.   The contents of this file should be 
java.naming.security.principal=myusername
java.naming.security.credentials=mypassword

 

Do NOT place anything in the transformer's username/password fields.   

Still looking for some documentation on what "Additional Provider Properties" does, and how they should be formatted.

Thanks to Steve for the assistance.

 

There is a problem with this approach:  if we have more than one workspace using different JMS username/passwords, they will unfortunately both use the same jndi.properties file i.e. will use the same username/password.   


I looked at this yesterday with our Developer. We determined this configuration is possible with FME Server (tested with the Publisher) but that there is indeed an issue in FME Desktop as @neilhellas indicates. If anyone is attempting to do this in FME Desktop 2020.1 or less we may be able to work with you to provide a workaround in FME Desktop. Contact us at www.safe.com/support (report a problem - indicate this KB) This should be resolved in new versions of FME 2020 and I'll update this KB with that happens.

Here are the steps for FME Server (I used FME Server 2019.2).

1) Copy the following jars to <installPath>\\FMEServer\\Server\\lib\\jms

These jars can be downloaded from https://solace.com/downloads/ got to the section "Open API's + Protocols" and click on the JMS icon (direct link: https://products.solace.com/download/JMS_API).

2) In the FME Server UI configure the new Publisher (or Subscriber)

NOTE: Anything with < > will need to be properly configured as well as the Destination queue name.

That should be in. To see if this is reading from the Solace Queue review the jms.log file found in Resources>Logs>core>current>publishers

You should something along these lines being logged after adding the publisher

Adding publication "Solace" ...Connecting to JMS provider with url "tcp://<somehost>.<mydomain>.com" and initial context "com.solacesystems.jndi.SolJNDIInitialContextFactory" ...Successfully connected to JMS provider.Setting up JMS message listener for destination "<queue>" ...Successfully set up JMS message listener.Received JMS message from destination "<queue>".

I hope this helps anyone using the Solace JMS service.

 


It turns out that "Additional Provider Properties" does not work the same as a jndi.properties file.

The resolution in this case was to:

  • Create a jndi.properties file, place this in the FME plugins directory.   The contents of this file should be 
java.naming.security.principal=myusername
java.naming.security.credentials=mypassword

 

Do NOT place anything in the transformer's username/password fields.   

Still looking for some documentation on what "Additional Provider Properties" does, and how they should be formatted.

Thanks to Steve for the assistance.

 

To be clear - the "Additional Provider Properties" are being ignored in the JMSReceiver transformer.  This will be resolved in a future release of FME Desktop and will avoid the requirement of the jndi.properties file.


Reply