How to notify clean TCP messages in WSO2 ESB

I have an application (say TcpApp) that sends pure TCP messages (i.e., SOAP, without an envelope ... just an raw string or even bytes). I need to connect an ESB to listen to these messages over a specific port (say, 3333) and do some mediation (at the moment, do nothing but the log). I think it would be nice to create an ActiveMQ queue from TcpApp and then make a proxy service from JMS to ESB (instead of directly connecting the ESB to TcpApp). I read a few examples and answers, but it always contradicts XML, and TCP is just a transport. It sometimes happens that applications do not send any special formats via TCP (sometimes called telegrams). I tried to change the content type, but the ESB refuses to read the TCP port.

<parameter name="transport.tcp.contentType">text/plain</parameter>

Maybe I'm still confused with the solution architecture, but I think that a broker or ESB, such as WSO2, should work, this is the case as an intermediary from this TcpApp. I prefer to resolve the solution earlier in order to get the real configuration in order to make it work. All comments are welcome!

+4
source share
2 answers

In WSO2 EI 6.1.1, I found that I can successfully process TCP text messages if I also specify recordDelimiter and recordDelimiterType. Example from a working proxy (with a line feed as a delimiter):

<parameter name="transport.tcp.responseClient">true</parameter>
<parameter name="transport.tcp.inputType">binary</parameter>
<parameter name="transport.tcp.recordDelimiter">0x0A</parameter>
<parameter name="transport.tcp.contentType">text/plain</parameter>
<parameter name="transport.tcp.port">50001</parameter>
<parameter name="transport.tcp.recordDelimiterType">byte</parameter>

The body of the message in the input sequence is as follows:

<text xmlns="http://ws.apache.org/commons/ns/payload">this_is_the_message</text>
0
source

-. axis2.xml.

<messageFormatter contentType="application/binary" class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
<messageBuilder contentType="application/binary" class="org.wso2.carbon.relay.BinaryRelayBuilder"/>

, , -. [1]:)

[1] - http://soatechflicks.blogspot.com/2017/05/processing-binary-data-from-tcp.html

0

Source: https://habr.com/ru/post/1527989/


All Articles