Search code examples
jmsjndiflumeflume-ng

Flume is not picking my JMS binding file


I am trying to set up a flume agent that uses JMS as the source and HDFS as the sink.

The steps I have followed are

1) Created a .binding file by

```

git clone https://github.com/ibm-messaging/mq-docker.git

docker volume create qm1data

docker run \
  --env LICENSE=accept \
  --env MQ_QMGR_NAME=QM1 \
  --publish 1414:1414 \
  --publish 9443:9443 \
  --volume mqvol:/tmp/mq --detach mq

go to /opt/mqm/java/bin/JMSAdmin ->

DEFINE QCF(confact) QMGR(QM1) tran(client) chan(DEV.ADMIN.SVRCONN) host(10.2.201.80) port(1414)
DEFINE Q(DEV.QUEUE.1) QUEUE(DEV.QUEUE.1) QMGR(QM1)
end

```

2) drop the related jars and .binding file in place using the following helpful link how to use .binding file for JMS to HDFS

3) Start flume agent only to get the following error message

org.apache.flume.FlumeException: Could not lookup ConnectionFactory
    at org.apache.flume.source.jms.JMSSource.doConfigure(JMSSource.java:233)
    at org.apache.flume.source.BasicSourceSemantics.configure(BasicSourceSemantics.java:65)
    at org.apache.flume.source.AbstractPollableSource.configure(AbstractPollableSource.java:65)
    at org.apache.flume.conf.Configurables.configure(Configurables.java:41)
    at org.apache.flume.node.AbstractConfigurationProvider.loadSources(AbstractConfigurationProvider.java:326)
    at org.apache.flume.node.AbstractConfigurationProvider.getConfiguration(AbstractConfigurationProvider.java:101)
    at org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run(PollingPropertiesFileConfigurationProvider.java:141)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: javax.naming.NameNotFoundException: confact
    at com.sun.jndi.fscontext.RefFSContext.getObjectFromBindings(RefFSContext.java:400)
    at com.sun.jndi.fscontext.RefFSContext.lookupObject(RefFSContext.java:327)
    at com.sun.jndi.fscontext.RefFSContext.lookup(RefFSContext.java:146)
    at com.sun.jndi.fscontext.FSContext.lookup(FSContext.java:127)
    at javax.naming.InitialContext.lookup(InitialContext.java:411)
    at org.apache.flume.source.jms.JMSSource.doConfigure(JMSSource.java:231)

where confact is the factory i created.

The binding file looks similar to

cat /var/lib/flume-ng/plugins.d/ibmmqjms/jndi/.binding|head -10
#This file is used by the JNDI FSContext.
#Sun Feb 18 13:41:26 UTC 2018
confact/RefAddr/30/Encoding=String
confact/RefAddr/19/Content=unspecified
confact/RefAddr/26/Content=1
confact/RefAddr/33/Content=0
confact/RefAddr/70/Content=443
confact/RefAddr/15/Content=false
confact/RefAddr/22/Content=1
confact/RefAddr/102/Type=XMSC_CONNECTION_TYPE

I am suspecting that the JNDI binding is not happening because of some reason. Any help is appreciated.

Thanks ..Manas


Solution

  • The problem was that the binding file name should be called .bindings instead of .binding