简体   繁体   English

带有WSO2MB的WSO2ESB Rest API

[英]WSO2ESB Rest API with WSO2MB

I have three applications which should communicate together with bandwitch limit over 100,000 users. 我有三个应用程序,应该与限制超过100,000个用户的bandwitch一起通信。

We decide to use WSO2MB with WSO2ESB to publish messages between apps. 我们决定结合使用WSO2MB和WSO2ESB在应用之间发布消息。

The problem is that the target.endpoint do not get the message and I don't know why. 问题是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 消息存储

<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>

Message Processor 讯息处理器

<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 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

EDIT: 编辑:
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>

You have defined the below property. 您已经定义了以下属性。 But you haven't defined the endpoint in your synapse. 但是您尚未在突触中定义端点。

 <property name="target.endpoint" value="Test.Endpoint"></property>

If you have defined the value as Test.Endpoint there should be an endpoint defined. 如果您已将值定义为Test.Endpoint,则应定义一个端点。

Eg, 例如,

  <endpoint name="Test.Endpoint">
      <address uri="http://127.0.0.1:9000/services/SimpleStockQuoteService"/>
   </endpoint>

Please check our sample document : https://docs.wso2.com/display/ESB481/Sample+702%3A+Introduction+to+Message+Forwarding+Processor 请检查我们的样本文档: https : //docs.wso2.com/display/ESB481/Sample+702%3A+Introduction+to+Message+Forwarding+Processor

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM