Jiri Ondrusek created CAMEL-16357:
-------------------------------------
Summary: Camel-splunk: tcp mode can not work with port/host
mapping (e.g. in docker environment)
Key: CAMEL-16357
URL: https://issues.apache.org/jira/browse/CAMEL-16357
Project: Camel
Issue Type: Bug
Components: camel-splunk
Affects Versions: 3.8.0
Reporter: Jiri Ondrusek
Assignee: Jiri Ondrusek
TCP writer can connect only to splunk server, where its local port is the same
as its "outside" port.
Example:
* Splunk server is running via docker. It contains tcp port input definition
for e.g. *9998*. Port is mapped via docker to e.g. *12345*
* If I use remote tcp port *9998*, camel component tries to connect to
host:9998, which *fails*.
* If I use 12346 as remote port. Splunk server *fails*, because it doesn't
know port 12345
The same can be stated also for hostname.
Problem is caused in this method:
[https://github.com/apache/camel/blob/master/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/support/TcpDataWriter.java#L40]
I'd suggest to add new confguration property `*tcpLocalReceiverPort*`. Which
could be used in this case.
* If `*tcpLocalReceiverPort*` is defined, component will use this poer value
for splunk, but will use `*tcpReceiverPort*` for real connection.
* Functionality of `*tcpReceiverPort*` won't change in case of missing
`*tcpLocalReceiverPort*`.
For hostname there is no need to define a new property, because there is
already a `*host*`, which could be used in this case.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)