<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to pass parameters into a custom JMS Modular Input Message Handler in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-pass-parameters-into-a-custom-JMS-Modular-Input-Message/m-p/225757#M24939</link>
    <description>&lt;P&gt;Thanks for this!  I was hoping it would be straightforward to use setParams(), just didn't know the "config" side of the equation.  I will test it out and report back.&lt;/P&gt;</description>
    <pubDate>Thu, 14 Jan 2016 15:14:29 GMT</pubDate>
    <dc:creator>mcormier_splunk</dc:creator>
    <dc:date>2016-01-14T15:14:29Z</dc:date>
    <item>
      <title>How to pass parameters into a custom JMS Modular Input Message Handler</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-pass-parameters-into-a-custom-JMS-Modular-Input-Message/m-p/225755#M24937</link>
      <description>&lt;P&gt;I'm working on a project to convert binary JMS message bodies to Strings.  I've built the converter and will integrate it using the template you've laid out in Splunk Answers&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/310006/how-to-convert-byte-characters-coming-out-of-mq-th.html"&gt;https://answers.splunk.com/answers/310006/how-to-convert-byte-characters-coming-out-of-mq-th.html&lt;/A&gt;  &lt;/P&gt;

&lt;P&gt;I've run into a problem.  The converter uses a properties file to describe the message format.  How can I get the file path/name passed into this class so I can load the message format?  I see the setParams (Map&amp;lt;String, String&amp;gt; params) method, but don't know &lt;BR /&gt;
(a) if that's the right call and &lt;BR /&gt;
(b) how to initialize a parameter that might get passed into this call in the first place.&lt;/P&gt;

&lt;P&gt;Anyone have an example of how they've done this, how it might be done, or a pointer to documentation? &lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2016 14:29:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-pass-parameters-into-a-custom-JMS-Modular-Input-Message/m-p/225755#M24937</guid>
      <dc:creator>mcormier_splunk</dc:creator>
      <dc:date>2016-01-14T14:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass parameters into a custom JMS Modular Input Message Handler</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-pass-parameters-into-a-custom-JMS-Modular-Input-Message/m-p/225756#M24938</link>
      <description>&lt;P&gt;Config example :&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/950i4EE3529A05907955/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Rough code example : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;package com.splunk.modinput.jms.custom.handler;

import java.io.File;
import java.util.Map;

import javax.jms.Message;

import com.splunk.modinput.jms.AbstractMessageHandler;
import com.splunk.modinput.jms.JMSModularInput.MessageReceiver;

public class ExampleMessageHandler extends AbstractMessageHandler {

    private final static String MSG_FORMAT_FILE_PARAM = "msg_format_file";

    private File msgFormatFile;

    @Override
    public void handleMessage(Message message, MessageReceiver context) throws Exception {


        String event = decodeMessageBody(message);

        transportMessage(event, String.valueOf(System.currentTimeMillis()), "");

    }

    private String decodeMessageBody(Message message) {
        String result = "";
        try {

           //TODO your logic to pull out the message bytes and decode them

        } catch (Exception e) {}

        return result;

    }

    @Override
    public void setParams(Map&amp;lt;String, String&amp;gt; params) {

        if (params.containsKey(MSG_FORMAT_FILE_PARAM))
            this.msgFormatFile = new File(params.get(MSG_FORMAT_FILE_PARAM));

    }

}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Jan 2016 15:08:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-pass-parameters-into-a-custom-JMS-Modular-Input-Message/m-p/225756#M24938</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2016-01-14T15:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass parameters into a custom JMS Modular Input Message Handler</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-pass-parameters-into-a-custom-JMS-Modular-Input-Message/m-p/225757#M24939</link>
      <description>&lt;P&gt;Thanks for this!  I was hoping it would be straightforward to use setParams(), just didn't know the "config" side of the equation.  I will test it out and report back.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2016 15:14:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-pass-parameters-into-a-custom-JMS-Modular-Input-Message/m-p/225757#M24939</guid>
      <dc:creator>mcormier_splunk</dc:creator>
      <dc:date>2016-01-14T15:14:29Z</dc:date>
    </item>
  </channel>
</rss>

