use of com.splunk.Receiver in project camel by apache.
the class StreamDataWriter method createSocket.
@Override
protected Socket createSocket(Service service) throws IOException {
Index indexObject = null;
Receiver receiver = null;
Socket socket = null;
if (index != null) {
indexObject = service.getIndexes().get(index);
if (indexObject == null) {
throw new RuntimeCamelException(String.format("cannot find index [%s]", index));
}
socket = indexObject.attach(args);
} else {
receiver = service.getReceiver();
socket = receiver.attach(args);
}
socket.setTcpNoDelay(true);
LOG.trace(String.format("created a socket on %s", socket.getRemoteSocketAddress()));
return socket;
}
use of com.splunk.Receiver in project camel by apache.
the class SubmitDataWriter method doWrite.
@Override
protected void doWrite(String event) throws IOException {
Index index = getIndex();
if (index != null) {
index.submit(args, event);
} else {
Receiver receiver = endpoint.getService().getReceiver();
receiver.submit(args, event);
}
}
Aggregations