2
votes

I'm using logstash to read a CSV file and post the information to my ActiveMQ using the stomp protocol.

Everything is working great, I only want to add persistence to those messages but I don't know how to tell logstash to do so.

The ActiveMQ site say I need to tell my stomp producer to add the "persistent:true" parameter, but I don't find any documentation about this on logstash site.

Anyone knows anything about this?

Thanks in advance,

http://activemq.apache.org/stomp.html

2

2 Answers

1
votes

Well, persistence cannot be set on logstash stomp output.

If this is very important to you, it should be a simple fix in the source.

You can find the file here:

And this line:

@client.send(event.sprintf(@destination), event.to_json)

should be something like this:

@client.send(event.sprintf(@destination), event.to_json, :persistent => true)

You have to build it and install the plugin yourself. My Ruby skills are limited so I have no idea how to do that. Maybe consider adding that as a config param and contribute it with a pull request?

0
votes

Now you can use the attribute headers to send persistent messages:

stomp {
  host => "localhost"
  port => 61612
  destination => "my_queue"
  headers => {
    "persistent" => true
  }
}

Source: https://github.com/logstash-plugins/logstash-output-stomp/issues/7