相关文章推荐
霸气的书签  ·  Multi-method ...·  6 天前    · 
腼腆的大象  ·  使用node.js 调用 ...·  1 年前    · 
阳光的甜瓜  ·  asp.net - Convert ...·  2 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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?

fyi.. there is a third option of specifying amqp and ssl that I have seen.. amqp:ssl:// (which still doesnt match any of the mappings) Inx51 Jan 15 at 22:38

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.

Yes, Im aware of that.. but that makes it all even more confusing.. since Apache.NMS.NMSConnectionFactory only includes a mapping for amqp scheme and not for amqps.. so I guess if my Uri would be specified as amqps://localhost, then Apache.NMS.NMSConnectionFactory would have no idea of how to map that to the correct ConnectionFactory. Or am I misstaken? – Inx51 Jan 16 at 17:56 Thanks alot! I fully agree with that its strange to implement the factory pattern in the way Apache.NMS does it.. or at least it should cover all possible scenarios if to be used.. guess however I could create my own factory if so needed.. – Inx51 Jan 16 at 20:18 Sort of OT question.. but since you seem to "know your way around" in the domain of ActiveMQ :).. what would be the correct Uri for connecting using OpenWire? I have seen a sample where activemq:tcp://localhost:port is used.. but to me that looks strange.. and more like a work around to comply with NMS, since that would match with the mapping for – Inx51 Jan 16 at 20:23 The uri activemq:tcp://localhost:port does look strange, but it will work if you're using the NmsConnectionFactory implementation from Apache.NMS. However, I would recommend you using ConnectionFactory from Apache.NMS.ActiveMQ instead. That would allow you to use the more straight-forward tcp://localhost:port. – Justin Bertram Jan 16 at 21:06

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.