简体   繁体   English

探索在Wso2 ESB中使用主题和事件

[英]exploring the use of topic and event in Wso2 ESB

I'm exploring the use of topics and events in WSO2 ESB 4.8.1, I created a topic and subscribed to it the endpoint of one dataservice running in WSO2 WSAS(A), I supposed that if I published a message with the structure defined for the incoming message of one of A operations in the publish tool of the Topic Details console, the message would be sent to the supscriptor (A) and everything where going to work fine, but it don't. 我正在探索WSO2 ESB 4.8.1中主题和事件的使用,我创建了一个主题,并将其订阅到WSO2 WSAS(A)中运行的一个数据服务的端点,我认为如果发布的消息具有定义的结构对于“主题详细信息”控制台的发布工具中A操作之一的传入消息,该消息将被发送到下标器(A)以及所有可以正常工作的地方,但事实并非如此。 Why? 为什么? I also create a proxy service with an event mediator and configured the event mediator with the name of the created topic. 我还使用事件中介器创建了代理服务,并使用创建的主题的名称配置了事件中介器。 Then I Try the proxy service with an incoming message with the same structure explained before. 然后,我尝试使用具有与前面说明的相同结构的传入消息的代理服务。 I was expecting to at least get an incoming message in the WSAS Soap Tracer, but nothing happened. 我期望至少在WSAS Soap Tracer中收到传入消息,但是什么也没发生。 Am I missing something? 我想念什么吗?

The eventing infrastructure is based upon the WS-Eventing specification. 事件基础结构基于WS-Eventing规范。 Since you are using a WSDL based service as a subscriber of the topic and intend to invoke a specific operation of that service, I imagine it is failing because the SOAP message and/or SOAP action are incorrect because the message sent to the topic and the service are based around WS-Eventing and not your service. 由于您将基于WSDL的服务用作主题的订阅者,并打算调用该服务的特定操作,因此我想它失败了,因为SOAP消息和/或SOAP操作不正确,因为发送到该主题的消息和服务基于WS-Eventing,而不是您的服务。

I created the simple proxy below and subscribed it to a topic. 我在下面创建了简单的代理,并订阅了一个主题。

<proxy xmlns="http://ws.apache.org/ns/synapse" name="LogSubMessage" transports="http" statistics="disable" trace="disable" startOnLoad="true">
    <target>
        <inSequence>
            <log level="full" category="ERROR">
                <property name="SERVICE" value="LogSubMessage"/>
            </log>
        </inSequence>
        <outSequence><send/></outSequence>
    </target>
</proxy>

I then sent a <test/> message to the topic. 然后,我向该主题发送了<test/>消息。

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header>
        <ns:topic xmlns:ns="http://wso2.org/ns/2009/09/eventing/notify">topicname</ns:topic>
    </soapenv:Header>
    <soapenv:Body>
        <test/>
    </soapenv:Body>
</soapenv:Envelope>

As you can see in the message above, the message logged in the service contains WS-Eventing SOAP headers and the SOAP action was set to http://ws.apache.org/ws/2007/05/eventing-extended/Publish . 如您在上面的消息中看到的那样,服务中记录的消息包含WS-Eventing SOAP标头,并且SOAP操作已设置为http://ws.apache.org/ws/2007/05/eventing-extended/Publish If your data service requires that the SOAP header contain the name of the operation to invoke, then it would reject this request. 如果您的数据服务要求SOAP标头包含要调用的操作的名称,则它将拒绝该请求。

I would suggest creating a proxy service, similar to the the one above, that would subscribe to the topic. 我建议创建一个代理服务,类似于上面的代理服务,以订阅该主题。 This service would set the correct SOAP action, perform any message transformations you need, and call your data service. 该服务将设置正确的SOAP操作,执行所需的任何消息转换,然后调用数据服务。

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

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