camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Apachem Camel with Oracle AQ
Date Fri, 24 Apr 2009 10:47:03 GMT
On Fri, Apr 24, 2009 at 12:26 PM, sebodev <sebastian.bergandy@btc-ag.com> wrote:
>
> Hi,
>
> the problem ist fixed. If i have putted a jar orai18n.jar as dependency into
> project then receiving for messages from queue starts to working. Thank you
> for your replies.
Thanks for sharing this information.

And glad you got it working at the end.

>
> Kind regards
> Sebastian
>
>
> sebodev wrote:
>>
>> Hi James,
>>
>> it is not a permission issue because i please my administrator to give me
>> all administrator perrmisions for tests. It doesn't help. If i fix the
>> problem i will write a comment.
>>
>> Thanks.
>>
>> Kind regards
>> Sebastian
>>
>>
>> James.Strachan wrote:
>>>
>>> BTW it looks like Oracle is exposing nulls in the exception message
>>> for some reason, so its a bit hard to see really why its barfing. (Its
>>> actually spring's JMS abstractions that fail).
>>>
>>> I wonder if its a permissions issue - that you don't have karma to
>>> consumer from the queue?
>>>
>>> 2009/4/2 sebodev <sebastian.bergandy@btc-ag.com>:
>>>>
>>>> Thank you for reply.
>>>>
>>>> You have right - i can't receiver this message using JMS API. The
>>>> exception
>>>> comes from AQjmsConsumer class which is a receiver implementation from
>>>> oracle. I can't debug it deeper because i don't have the sources. It
>>>> must be
>>>> some configuration issue.
>>>>
>>>> Kind regards
>>>> Sebastian
>>>>
>>>>
>>>> willem.jiang wrote:
>>>>>
>>>>> Please don't send the mail for request help to dev and user mail list
>>>>> at
>>>>> the same time. Most developer monitor these two mail list.
>>>>>
>>>>> From the stack trace , I guess it's an AQ's setup issue.
>>>>> Maybe you can try to write a normal JMS code to test if you can get the
>>>>> message from the remote AQ's Queue.
>>>>>
>>>>>
>>>>> Willem
>>>>>
>>>>> sebodev wrote:
>>>>>> Hi,
>>>>>>
>>>>>> i'm using Oracle AQ with apache camel. I have a very simple code
like
>>>>>> this:
>>>>>>
>>>>>> ---
>>>>>> package pl.sbsd.apachecamel.oracleaq;
>>>>>>
>>>>>> import javax.jms.ConnectionFactory;
>>>>>>
>>>>>> import oracle.jdbc.pool.OracleDataSource;
>>>>>> import oracle.jms.AQjmsFactory;
>>>>>>
>>>>>> import org.apache.camel.CamelContext;
>>>>>> import org.apache.camel.Consumer;
>>>>>> import org.apache.camel.Exchange;
>>>>>> import org.apache.camel.Processor;
>>>>>> import org.apache.camel.ProducerTemplate;
>>>>>> import org.apache.camel.component.jms.JmsComponent;
>>>>>> import org.apache.camel.impl.DefaultCamelContext;
>>>>>>
>>>>>> public class OracleAQApp {
>>>>>>
>>>>>>      private String uri;
>>>>>>      private String login;
>>>>>>      private String password;
>>>>>>
>>>>>>      private final String jdbcUrl = "jdbc:oracle:thin:@xxx:1521:xxx";
>>>>>>
>>>>>>      private CamelContext camel;
>>>>>>      private ConnectionFactory connectionFactory;
>>>>>>      private ProducerTemplate producerTemplate;
>>>>>>
>>>>>>      public OracleAQApp(String uri, String login, String password)
>>>>>>                      throws Exception {
>>>>>>              this.uri = uri;
>>>>>>              this.login = login;
>>>>>>              this.password = password;
>>>>>>              OracleDataSource dataSource = new OracleDataSource();
>>>>>>              dataSource.setURL(jdbcUrl);
>>>>>>              dataSource.setUser(login);
>>>>>>              dataSource.setPassword(password);
>>>>>>              connectionFactory =
>>>>>> AQjmsFactory.getQueueConnectionFactory(dataSource);
>>>>>>              camel = new DefaultCamelContext();
>>>>>>              JmsComponent jmsComponent = new JmsComponent(camel);
>>>>>>              jmsComponent.setConnectionFactory(connectionFactory);
>>>>>>              camel.addComponent("jms", jmsComponent);
>>>>>>              producerTemplate = camel.createProducerTemplate();
>>>>>>              Consumer consumer =
>>>>>> camel.getEndpoint(uri).createConsumer(
>>>>>>                              new Processor() {
>>>>>>
>>>>>>                                      public void
process(Exchange
>>>>>> exchange) throws Exception {
>>>>>>                                            
 System.out.println("New
>>>>>> message!");
>>>>>>
>>>>>>  System.out.println(exchange.getIn().getBody());
>>>>>>                                      }
>>>>>>
>>>>>>                              });
>>>>>>              consumer.start();
>>>>>>              camel.start();
>>>>>>      }
>>>>>>
>>>>>>      public void send(String message) throws InterruptedException
{
>>>>>>              producerTemplate.sendBody(uri, message);
>>>>>>              Thread.sleep(500000);
>>>>>>      }
>>>>>>
>>>>>> }
>>>>>> ---
>>>>>>
>>>>>> I'm sending some message to the queue and the consumer will consume
>>>>>> it.
>>>>>> That
>>>>>> works with my local installation of oracle database. When i'm using
>>>>>> remote
>>>>>> database which is in the LAN then the messages are writting into
the
>>>>>> queue
>>>>>> but consumer can't dequeue them. In the eclipse console i get this
>>>>>> message:
>>>>>>
>>>>>> ---
>>>>>> Exception in thread "DefaultMessageListenerContainer-1"
>>>>>> java.lang.NullPointerException
>>>>>>      at java.lang.String.indexOf(String.java:1564)
>>>>>>      at java.lang.String.indexOf(String.java:1546)
>>>>>>      at
>>>>>> org.springframework.jms.support.JmsUtils.buildExceptionMessage(JmsUtils.java:255)
>>>>>>      at
>>>>>> org.springframework.jms.listener.DefaultMessageListenerContainer.handleListenerSetupFailure(DefaultMessageListenerContainer.java:745)
>>>>>>      at
>>>>>> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:897)
>>>>>>      at java.lang.Thread.run(Thread.java:595)
>>>>>> ---
>>>>>>
>>>>>> I have debugged the DefaultMessageListenerContainer and there is
a
>>>>>> exception
>>>>>> with information: "JMS-120: Dequeue failed.". I dont now what can
it
>>>>>> be.
>>>>>> Everythink works when i'm using local database. I've tested many
jdbc
>>>>>> drivers "ojdbc*.jar" and oracle aq apis "aqapi*.jar" but nothing.
I've
>>>>>> privileges to dequeue the messages.
>>>>>>
>>>>>> Kind regards
>>>>>> Sebastian
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Apachem-Camel-with-Oracle-AQ-tp22841659p22849209.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> James
>>> -------
>>> http://macstrac.blogspot.com/
>>>
>>> Open Source Integration
>>> http://fusesource.com/
>>>
>>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Apachem-Camel-with-Oracle-AQ-tp22841659p23213775.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus
Apache Camel Reference Card:
http://refcardz.dzone.com/refcardz/enterprise-integration

Mime
View raw message