我有三个应用程序应该与bandwitch 限制超过100,000 个用户一起通信。
我们决定使用 WSO2MB 和 WSO2ESB 在应用程序之间发布消息。
问题是 target.endpoint 没有收到消息,我不知道为什么。
<api xmlns="http://ws.apache.org/ns/synapse" name="School" context="/schools">
<resource methods="POST" url-mapping="/" faultSequence="fault">
<inSequence>
<log level="custom">
<property name="Message Flow" value="--- Schools POST ---"></property>
</log>
<property name="REST_URL_POSTFIX" scope="axis2" action="remove"></property>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"></property>
<property name="OUT_ONLY" value="true"></property>
<property name="target.endpoint" value="Test.Endpoint"></property>
<log level="custom">
<property name="Message Flow" value="--- Schools POST ---"></property>
</log>
<store messageStore="JMSMS"></store>
<log level="full"></log>
</inSequence>
</resource>
</api>
消息存储
<messageStore name="JMSMS" class="org.apache.synapse.message.store.impl.jms.JmsStore" xmlns="http://ws.apache.org/ns/synapse">
<parameter name="java.naming.factory.initial">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="java.naming.provider.url">repository/conf/jndi.properties</parameter>
<parameter name="store.jms.destination">JMSMS</parameter>
<parameter name="store.jms.connection.factory">QueueConnectionFactory</parameter>
<parameter name="store.jms.username">admin</parameter>
<parameter name="store.jms.password">admin</parameter>
<parameter name="store.jms.JMSSpecVersion">1.1</parameter>
</messageStore>
消息处理器
<messageProcessor name="JMSMS" class="org.apache.synapse.message.processor.impl.forwarder.ScheduledMessageForwardingProcessor" targetEndpoint="Test.Endpoint" messageStore="JMSMS" xmlns="http://ws.apache.org/ns/synapse">
<parameter name="interval">1000</parameter>
<parameter name="client.retry.interval">1000</parameter>
<parameter name="is.active">true</parameter>
</messageProcessor>
Jndi.properties
connectionfactory.QueueConnectionFactory = amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5673'
connectionfactory.TopicConnectionFactory = amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5673'
queue.JMSMS=JMSMS
编辑:
Test.Endpoint
<?xml version="1.0" encoding="UTF-8"?>
<endpoint xmlns="http://ws.apache.org/ns/synapse" name="Test.Endpoint">
<http method="post" uri-template="http://10.0.2.2:8000/super/test"/>
</endpoint>