为什么我不能使用hornetq-core-client.2.2.21.Final.jar创建一个简单的 stomp 客户端?
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("host", "localhost");
properties.put("port", 61612);
properties.put("protocol", "stomp");
TransportConfiguration transportConfiguration = new TransportConfiguration(NettyConnectorFactory.class.getName(), properties);
ServerLocator serverLocator = HornetQClient.createServerLocatorWithoutHA(transportConfiguration);
ClientSessionFactory clientSessionFactory = serverLocator.createSessionFactory();
ClientSession clientSession = clientSessionFactory.createSession();
clientSession.createQueue("queue", "queue", true);
ClientProducer clientProducer = clientSession.createProducer("queue");
ClientMessage clientMessage = clientSession.createMessage(true);
clientMessage.getBodyBuffer().writeString("Hello");
clientProducer.send(clientMessage);
我收到以下错误:
java.lang.IllegalStateException:以下键对配置连接器无效:协议