Hi,
I'm trying to configure synapse to receive syslog messages (RFC 5424) via tcp,
parse them, and according to certain properties (sender?), send as JMS messages
to different topics in a messaging provider.
At the moment I'm trying to get the first part running - setup a tcp-listener
that accepts
plain text messages - and for now, just writes the message to HTTP (as in
sample 265).
What I've done so far:
1. Tried the TCPServer by copying "axis2-transport-tcp-1.0.0.jar" to
$SYNAPSE_HOME/libs
and using the following config:
1.1 axis2.xml
<transportReceiver name="tcp" class="org.apache.axis2.transport.tcp.TCPServer">
<parameter name="port">6060</parameter>
</transportReceiver>
<transportSender name="tcp"
class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
1.2 start_TCPsrv_HTTP.xml
<definitions xmlns="http://ws.apache.org/ns/synapse">
<!-- Input is a TCP request with a SYSLOG message file -->
<!-- Definitions for TCPServer: -->
<proxy name="tcp2Http" transports="tcp">
<target>
<inSequence>
<log level="full"/>
</inSequence>
<outSequence>
<log level="full"/>
<send/>
</outSequence>
<endpoint>
<address uri="http://mdzhlfesb01:50000"/>
</endpoint>
</target>
</proxy>
</definitions>
It seems however, that only SOAP messages are supported by the TCPServer class
(kept on getting error messages about incorrect message format)
Sent the message "hello world" and got:
Unexpected character 'h' (code 104) in prolog; expected '<'
2. Found this link about support for content-type being added to the
tcp-listener
http://mail-archives.apache.org/mod_mbox/synapse-user/201102.mbox/raw/%[email protected]%3e/1
I found this web page and downloaded "axis2-transport-tcp-1.1.0-SNAPSHOT.jar"
from here:
http://maven.wso2.org/nexus/content/groups/wso2-public/org/apache/axis2/axis2-transport-tcp/1.1.0-SNAPSHOT/
and copied it to $SYNAPSE_HOME/libs (renamed axis2-transport-tcp-1.0.0.jar -->
axis2-transport-tcp-1.0.0.jar.old)
1.1 axis2.xml
<transportReceiver name="tcp"
class="org.apache.axis2.transport.tcp.TCPTransportListener">
<parameter name="transport.tcp.contentType">text/plain</parameter>
<parameter name="transport.tcp.port">6060</parameter>
</transportReceiver>
<transportSender name="tcp"
class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
1.2 start_TCPlis_HTTP.xml
<!-- Taken from synapse sample 265: TCP -> HTTP -->
<definitions xmlns="http://ws.apache.org/ns/synapse">
<!-- Definitions for TCPTransportListener -->
<proxy name="tcp2http" transports="tcp" startOnLoad="true" trace="disable">
<target>
<endpoint>
<address uri="http://mdzhlfesb01:50000"/>
</endpoint>
<inSequence>
<property name="messageType" value="text/plain" scope="axis2"/>
<property name="OUT_ONLY" value="true"/>
<log level="full"/>
</inSequence>
</target>
</proxy>
</definitions>
At startup, I get the following warnings:
2013-07-05T13:31:40,INFO
,mdzhsfesb01,MSGMED,AbstractTransportListener.java:176,TCP Listener started
2013-07-05T13:31:40,WARN
,mdzhsfesb01,MSGMED,AbstractTransportListener.java:224,Unable to configure the
service tcp2http for the TCP transport: Service doesn't have configuration
information for transport tcp. This service is being marked as faulty and will
not be available over the TCP transport.
2013-07-05T13:31:40,WARN
,mdzhsfesb01,MSGMED,AbstractTransportListener.java:192,Disabling the tcp
transport for the service tcp2http, because it is not configured properly for
the service
It seems I'm missing some configuration information for TCP, and the TCP
service is then disabled.
Any help would be greatly appreciated!
Thanks,
Peter
The content of this e-mail is intended only for the confidential use of the
person addressed.
If you are not the intended recipient, please notify the sender and delete this
email immediately.
Thank you.