【发布时间】:2018-12-14 00:33:05
【问题描述】:
我正在尝试创建持久的端点。我正在使用 solace-jms-spring-boot-starter。
我是如何尝试的:
amqp:topic:testTopic?clientId=1&durableSubscriptionName=Test&subscriptionDurable=true
OR
@Autowired
private JmsTemplate jmsTemplate;
final ConnectionFactory connectionFactory1 = jmsTemplate.getConnectionFactory();
final Connection connection1 = connectionFactory1.createConnection();
final int sessionAcknowledgeMode = jmsTemplate.getSessionAcknowledgeMode();
Session session = connection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
final Topic topic = session.createTopic(testTopic);
session.createDurableSubscriber(topic,"Test","",true);
主题不是创建,我在 SolAdmin 中看不到它。然后我手动创建了持久主题“testTopic”。但我无法创建订阅者。 我有以下错误:
org.apache.camel.spring.boot.CamelSpringBootInitializationException: javax.jms.JMSSecurityException: Error creating consumer - unknown endpoint (503: Unknown Durable Topic Endpoint)
at org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:133) ~[camel-spring-boot-2.20.2.jar:2.20.2]
at org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:57) ~[camel-spring-boot-2.20.2.jar:2.20.2]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]
...
Caused by: com.solacesystems.jcsmp.JCSMPErrorResponseException: 503: Unknown Durable Topic Endpoint
at com.solacesystems.jcsmp.impl.flow.BindRequestTask.execute(BindRequestTask.java:161) ~[sol-jms-10.5.0.jar:na]
at com.solacesystems.jcsmp.impl.flow.SubFlowManagerImpl.handleAssuredCtrlMessage(SubFlowManagerImpl.java:534) ~[sol-jms-10.5.0.jar:na]
at com.solacesystems.jcsmp.protocol.impl.TcpClientChannel.handleAssuredCtrlMsg(TcpClientChannel.java:1640) ~[sol-jms-10.5.0.jar:na]
at com.solacesystems.jcsmp.protocol.impl.TcpClientChannel.handleMessage(TcpClientChannel.java:1608) ~[sol-jms-10.5.0.jar:na]
at com.solacesystems.jcsmp.protocol.nio.impl.SubscriberMessageReader.processRead(SubscriberMessageReader.java:98) ~[sol-jms-10.5.0.jar:na]
创建一个非持久端点没有问题。 我已经实现了一些 JUnit 来测试持久端点。 (所有的都是成功的)。不同之处在于我正在创建我的 connectionFactory:
JmsConnectionFactory connectionFactory = new JmsConnectionFactory(username, password, url);
AMQPComponent amqp = new AMQPComponent();
amqp.setConnectionFactory(connectionFactory);
context.addComponent("amqp", amqp);
我不明白。我错过了什么?如果这是一个安全问题(比如我没有权限,为什么我可以从我的 Junits 创建持久主题?)
【问题讨论】:
标签: spring-boot gradle apache-camel jms-topic solace