Spring boot 安慰:未知的持久话题终结点
我正在尝试创建持久的端点。我正在使用solace jms spring boot starter 我是如何尝试的:Spring boot 安慰:未知的持久话题终结点,spring-boot,gradle,apache-camel,jms-topic,solace,Spring Boot,Gradle,Apache Camel,Jms Topic,Solace,我正在尝试创建持久的端点。我正在使用solace jms spring boot starter 我是如何尝试的: amqp:topic:testTopic?clientId=1&durableSubscriptionName=Test&subscriptionDurable=true OR @Autowired private JmsTemplate jmsTemplate; final ConnectionFactory connectionFactory1 = jmsT
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);
主题不是create,我在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+message broker上提供名为Test的持久主题端点,以便客户端绑定到它。设置后,主题 当客户端绑定到端点时,subscription testTopic将应用于该端点,并且客户端将接收发布到此主题的所有消息 有关设置持久主题终结点的详细信息,请参见:
非持久主题终结点与持久主题终结点的不同之处在于,它是由客户端应用程序动态创建的,并且仅在连接客户端会话时持久存在于message broker上。这就是为什么您可以毫无问题地创建非持久主题终结点。我已经创建了主题测试,我可以在solAdmin中看到它,然后我最终的主题=session.createTopictest;createDurableSubscribertopic,test,,true;它是这样工作的。但我理解的是,我可以有一个名为Test2的主题,然后有多个持久的端点指向该主题。例如,durableSubscriptionName=endpoint1,clientId=2;durableSubscriptionName=endpoint2,clientId=2。这个例子在JUnit中工作,如果我试图实现这个Iget,为什么会出现错误?我理解错了吗?这就是为什么我有topic testTopic和持久端点test的名称,我希望有多个订阅者订阅同一个主题。具有不同名称和客户端的多个端点在相同情况下客户端应相同