Open ghost opened 6 years ago
because some time occure next exception: [2018-01-05T10:24:52,132][WARN ][logstash.inputs.jms ] JMS Exception has occurred: JMSWMQ1107: A problem with this connection has occurred. [2018-01-05T10:24:52,132][WARN ][logstash.inputs.jms ] JMS Exception has occurred: JMSWMQ1107: A problem with this connection has occurred. [2018-01-05T10:24:52,132][WARN ][logstash.inputs.jms ] JMS Exception has occurred: JMSWMQ1107: A problem with this connection has occurred.
is it possible to add some functionality to try catch some java exception in run method:
import java.net.ConnectException
import com.ibm.msg.client.jms.DetailedIllegalStateException
import com.ibm.mq.MQException
import com.ibm.mq.jmqi.JmqiException
....
public
def run(output_queue)
maxTries=5
currentTries=1
while (currentTries <= maxTries)
begin
case @runner
when "consumer" then
run_consumer(output_queue)
when "async" then
run_async(output_queue)
when "thread" then
run_thread(output_queue)
end
rescue ConnectException, DetailedIllegalStateException, MQException, JmqiException => connectException
@logger.warn("current attempt is #{currentTries}")
@logger.warn("#{connectException}")
@logger.warn("Message: #{connectException.message}")
@logger.warn(puts "Backtrace: #{connectException.backtrace}")
end
end
end
It would be quite useful to be able to automatically recover after network incident and not silently die.
I am facing the same problem... sometimes I am losing the connectivity with my JMS server (Tibco EMS), I can find the error below on logstash-plain.txt and would be excelent if the logstash could retry connect to it.
[logstash.inputs.jms ] JMS Exception has occurred: Connection has been terminated due to missing server heartbeats
If you have set a mq connection factory you can do this (the code below comes from one of my java projects) :
mqQueueConnectionFactory.setClientReconnectOptions(WMQConstants.WMQ_CLIENT_RECONNECT);
I have the same problem here. i 'm getting messages from an Apache ActiveMQ server and i'm using those confs:
input
{
jms
{
yaml_file => "/usr/share/logstash/activemq/jms.yml"
yaml_section => "activemq"
destination => "MyTopic"
runner => "async"
pub_sub => true
}
}
yml:
activemq:
:factory: org.apache.activemq.ActiveMQConnectionFactory
:broker_url: failover:(tcp://IP:PORT)?initialReconnectDelay=100&maxReconnectDelay=2000
:username: usr
:password: pass
:require_jars:
- /usr/share/logstash/activemq/activemq-all-5.15.8.jar
Every time the server goes down, the logstash crashes and i have to manually restart the pipelines. Hell! theres' no try/catch on this?
This should have been resolved by #35
Hello guys,
is it possible add functionality to reconnect to queue manager in case with some network partitions or problem with queue manager?