.netsslamqpactivemq-artemisnms

How to use SSL when using Apache.NMS.AMQP?


Im currently trying to implement support for AMQP into a .Net library. However, I cant quite figure out which schema to use when running AMQP and SSL. From Googling it I see that there are two schemas that are suggested from time to time: amqps:// and amqp+ssl://. However, looking at the Apache.NMS implementation of the NMSConnectionFactory, not any of those two schemas would match against the connectionfactory mappings.

The map is located at line 58-77, and it's used at line 308. As you might notice neither amqps nor amqp+ssl are listed in the mapping-object. So how would one use SSL and AMQP while using Apache.NMS?


Solution

  • It's worth noting that the AMQP implementation for NMS is built on top of AMQP.NET Lite. The URL configuration documentation states:

    The basic format of the clients Connection URI is as follows:

    amqp[s]://hostname:port[?option=value[&option2=value...]]
    

    Where the amqps and scheme is specified to use SSL/TLS.

    A simple example is available here. Notice that the example uses the NmsConnectionFactory implementation from Apache.NMS.AMQP and not the one from Apache.NMS. I recommend you do the same.

    Apache.NMS is, after all, an API. It really shouldn't have its own implementation of NmsConnectionFactory as it needs to be updated every time a new implementation is created. In my opinion this is a backwards design which is confusing for users.