安慰:未知的持久主题端点

Solace: Unknown Durable Topic Endpoint

我正在尝试创建持久端点。我正在使用 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 创建持久主题?)

您订阅的主题似乎是 "testTopic",但客户端绑定的持久主题端点的名称是 "Test"。需要在 Solace PubSub+ 消息代理上提供这个名为 Test 的持久主题端点,以便客户端绑定到它。设置后,主题 当客户端绑定到端点时,订阅 "testTopic" 将应用于端点,并且客户端将收到发布到该主题的所有消息。

有关配置持久主题端点的更多信息,请参见此处: https://docs.solace.com/Configuring-and-Managing/Configuring-DTEs.htm

非持久主题端点与持久主题端点的不同之处在于,它是由客户端应用程序动态创建的,并且仅在客户端会话连接时才保留在消息代理上。这就是为什么您能够毫无问题地创建非持久主题端点的原因。