All Apps and Add-ons

How to connect to Oracle AQ with JMS Messaging Modular Input? Is there a trick for the prefix?

alaendle
New Member

I'm trying to connect to a Oracle AQ via JMS.

I'm facing the following error message.

Stanza jms://queue/:quelogentry : Error connecting : javax.naming.NamingException: Cannot resolve name:quelogentry [Root exception is javax.naming.NamingException: Unrecognized prefix in: quelogentry]
at oracle.jms.AQjmsContext.lookup(AQjmsContext.java:170)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.splunk.modinput.jms.JMSModularInput$MessageReceiver.connect(Unknown Source)
at com.splunk.modinput.jms.JMSModularInput$MessageReceiver.run(Unknown Source)
Caused by: javax.naming.NamingException: Unrecognized prefix in: quelogentry
at oracle.jms.AQjmsContext.lookup(AQjmsContext.java:149)
... 3 more

However I have no idea how I need to configure the prefix so that the queues name is accepted.
For now I keep short, so please let me know if I can provide additional information.

Thanks in advance for any hint/assistance.

Best regards,

Andreas

0 Karma

Damien_Dallimor
Ultra Champion

You are probably not entering your Oracle AQ JNDI queue name correctly.

I know nothing about Oracle AQ , but what do the Oracle AQ docs say ? What are the Oracle AQ JMS settings your configured on the Oracle AQ side ?

Quick googling found :

http://docs.oracle.com/cd/E21764_01/web.1111/e13727/implement.htm#JMSPG203
http://docs.oracle.com/cd/E21764_01/web.1111/e13727/lookup.htm#JMSPG918

0 Karma

alaendle
New Member

No special settings on the DB side. Just a simple queue - but to dispel all doubts I can show you my SQL script creating the queue:

execute DBMS_AQADM.CREATE_QUEUE_TABLE(Queue_table => 'QUELOGENTRYINFO', Queue_payload_type => 'SYS.AQ$_JMS_TEXT_MESSAGE');
execute DBMS_AQADM.CREATE_QUEUE(Queue_name => 'QUELOGENTRY', Queue_table => 'QUELOGENTRYINFO', Max_retries => 5);
execute DBMS_AQADM.START_QUEUE(Queue_name => 'QUELOGENTRY');

I have successfully connected the queue from logstash with the following configuration:

:jndi_name: ConnectionFactory
:jndi_context:
java.naming.factory.initial: oracle.jms.AQjmsInitialContextFactory
java.naming.security.principal: my_user
java.naming.security.credentials: my_password
db_url: 'my_url'

destination => "quelogentry"

My problem can be reduced to the question how to translate these settings to a valid JMS Messaging Modular Input configuration. For now I couldn't find out how I could establish a connection to Oracle AQ.

Hope this gives you a better understanding of my problem.

Best regards,

Andreas

P.S.: May I vote for Java Runtime 1.8 support of the JMS plugin? 😉

0 Karma

Damien_Dallimor
Ultra Champion

Can you post your full inputs.conf stanza to assist in diagnosis ?

0 Karma

alaendle
New Member

Sure, but I fear you need to tell me where I can find the JMS configuration. I looked through all inputs.conf files under my Splunk windows installation, but I didn't find one containing my specific JMS configuration. The file /etc/system/local/inputs.conf just contains two lines:
[default]
host = my_hostname
Sorry, but I couldn't provide you more useful information at the moment 😞

0 Karma

Damien_Dallimor
Ultra Champion

You can't possibly have properly searched for your inputs.conf file because the JMS stanza gets persisted there and only there.

Look somewhere down under SPLUNK_HOME/etc/apps

0 Karma

alaendle
New Member

Thanks. Now I've found the requested information:

[jms://queue/:quelogentry]
browse_mode = stats
browse_queue_only = 0
durable = 0
hec_batch_mode = 0
hec_https = 0
index_message_header = 0
index_message_properties = 0
init_mode = jndi
jms_connection_factory_name = ConnectionFactory
jndi_initialcontext_factory = oracle.jms.AQjmsInitialContextFactory
jndi_pass = user
jndi_user = pass
output_type = stdout
sourcetype = _json
strip_newlines = 1
user_jndi_properties = db_url='my_connectionstring'

Please let me know if I could provide additional information.

0 Karma

Damien_Dallimor
Ultra Champion

Nothing looks particularly out of order config wise at a glance.Note: I dont know Oracle AQ settings though.

Does quelogentry need to be case sensitive ?
Any different behaviour if you run on JRE 8 ?
As per the error message , is there a prefix you can add to quelogentry ? ie: foobar.quelogentry

0 Karma

alaendle
New Member

Hi Damien,
for sure you are right with the prefix; I've tested it also without prefix so I've attached the 'wrong' input.conf. Just imagine that the first line contains "[jms://queue/:Queues/quelogentry]".

With this config the exception is raised a few lines later:
Stanza jms://queue/:Queues/quelogentry : Error connecting : javax.naming.NameNotFoundException: Cannot resolve name:Queues/quelogentry
at oracle.jms.AQjmsContext.lookup(AQjmsContext.java:184)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.splunk.modinput.jms.JMSModularInput$MessageReceiver.connect(Unknown Source)
at com.splunk.modinput.jms.JMSModularInput$MessageReceiver.run(Unknown Source)

By usage of the JavaDecompiler I guess that there occurs a swallowed (inner) exception in AQjmsContext.initQ. Unfortunately I didn't find a way to configure the properties "oracle.jms.traceLevel"/"oracle.jms.traceFile" to gain further insight.

Regarding JRE8, I wasn't able to use the addin under JRE8 - splunk just refused to load the plugin - should the addin be compatible with JRE8? But we could ignore the whole JRE8 thing here - I guess the more interesting part is the compatibility between the addin and Oracle AQ 😉

Thanks for your assistance.

Best regards,
Andreas

0 Karma

Damien_Dallimor
Ultra Champion

Your error is pretty normal in JNDI land : javax.naming.NameNotFoundException: Cannot resolve name:Queues/quelogentry

Is not a matter of the JMS Mod Input's compatibility , it just means you are not providing a correct JNDI lookup name as your queue name.

0 Karma
Get Updates on the Splunk Community!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...