未能为Oracle AQ配置jndi.properties Flume

时间:2015-03-17 14:18:46

标签: jms jndi flume oracle-aq

我尝试将Apache Flume应用来源与Oracle AQ相关联。 jndi.properties位于类路径中,配置如下:

java.naming.factory.initial=oracle.jms.AQjmsInitialContextFactory
java.naming.provider.url=tcp://my.db.url
java.naming.security.principal=remote
java.naming.security.credentials=remotepwd

我在日志中收到以下错误:

Source jmsSource has been removed due to an error during configuration
org.apache.flume.FlumeException: Could not create initial context oracle.jms.AQjmsInitialContextFactory provider tcp://my.db.url
....
Caused by: javax.naming.NamingException: The configuration of the AQjmsInitialContext is not complete.
The configuration must contain datasource or (db_url,java.naming.security.principal,java.naming.security.credentials) or both

我已经从示例中复制了java.naming.security.principal=remote java.naming.security.credentials=remotepwd,但我并不知道我需要插入的值是什么。

有关如何正确配置jndi.properties文件的任何建议吗?

1 个答案:

答案 0 :(得分:0)

根据错误消息(在我查看源代码之前我不清楚),通过db_url属性指定了db url。所以你想要像

这样的东西

java.naming.factory.initial=oracle.jms.AQjmsInitialContextFactory db_url=tcp://my.db.url java.naming.security.principal=remote java.naming.security.credentials=remotepwd