You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Rahul Jain <ra...@gmail.com> on 2015/06/22 19:29:14 UTC

java NullPointer exception in NotifyBuilder with camel-kafka component

Camel-kafka component (2.15.1) gives a NullPointer exception in
NotifyBuilder causing our assertions to fail.

The error seems to be due to the fact that the Exchange created by the
component has fromEndPoint set to null.

In KafkaEndpoint.java

   public Exchange createKafkaExchange(MessageAndMetadata<byte[], byte[]>
mm) {
        Exchange exchange = new DefaultExchange(getCamelContext(),
getExchangePattern());

I believe this should be instantiated as
Exchange exchange = new DefaultExchange(this, getExchangePattern());


-rahul

Re: java NullPointer exception in NotifyBuilder with camel-kafka component

Posted by Rahul Jain <ra...@gmail.com>.
Created a jira and submitted patch for this bug -
https://issues.apache.org/jira/browse/CAMEL-8908

On Tue, Jun 23, 2015 at 8:48 AM, Rahul Jain <ra...@gmail.com> wrote:

> Thanks. I'll submit a patch for this.
>
> On Mon, Jun 22, 2015 at 11:40 PM, Claus Ibsen <cl...@gmail.com>
> wrote:
>
>> Hi
>>
>> Yeah well spotted. You are welcome to log a JIRA and work on a patch / PR
>> http://camel.apache.org/support
>>
>> On Mon, Jun 22, 2015 at 7:29 PM, Rahul Jain <ra...@gmail.com> wrote:
>> > Camel-kafka component (2.15.1) gives a NullPointer exception in
>> > NotifyBuilder causing our assertions to fail.
>> >
>> > The error seems to be due to the fact that the Exchange created by the
>> > component has fromEndPoint set to null.
>> >
>> > In KafkaEndpoint.java
>> >
>> >    public Exchange createKafkaExchange(MessageAndMetadata<byte[],
>> byte[]>
>> > mm) {
>> >         Exchange exchange = new DefaultExchange(getCamelContext(),
>> > getExchangePattern());
>> >
>> > I believe this should be instantiated as
>> > Exchange exchange = new DefaultExchange(this, getExchangePattern());
>> >
>> >
>> > -rahul
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> Red Hat, Inc.
>> Email: cibsen@redhat.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen
>> hawtio: http://hawt.io/
>> fabric8: http://fabric8.io/
>>
>
>

Re: java NullPointer exception in NotifyBuilder with camel-kafka component

Posted by Rahul Jain <ra...@gmail.com>.
Thanks. I'll submit a patch for this.

On Mon, Jun 22, 2015 at 11:40 PM, Claus Ibsen <cl...@gmail.com> wrote:

> Hi
>
> Yeah well spotted. You are welcome to log a JIRA and work on a patch / PR
> http://camel.apache.org/support
>
> On Mon, Jun 22, 2015 at 7:29 PM, Rahul Jain <ra...@gmail.com> wrote:
> > Camel-kafka component (2.15.1) gives a NullPointer exception in
> > NotifyBuilder causing our assertions to fail.
> >
> > The error seems to be due to the fact that the Exchange created by the
> > component has fromEndPoint set to null.
> >
> > In KafkaEndpoint.java
> >
> >    public Exchange createKafkaExchange(MessageAndMetadata<byte[], byte[]>
> > mm) {
> >         Exchange exchange = new DefaultExchange(getCamelContext(),
> > getExchangePattern());
> >
> > I believe this should be instantiated as
> > Exchange exchange = new DefaultExchange(this, getExchangePattern());
> >
> >
> > -rahul
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/
>

Re: java NullPointer exception in NotifyBuilder with camel-kafka component

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yeah well spotted. You are welcome to log a JIRA and work on a patch / PR
http://camel.apache.org/support

On Mon, Jun 22, 2015 at 7:29 PM, Rahul Jain <ra...@gmail.com> wrote:
> Camel-kafka component (2.15.1) gives a NullPointer exception in
> NotifyBuilder causing our assertions to fail.
>
> The error seems to be due to the fact that the Exchange created by the
> component has fromEndPoint set to null.
>
> In KafkaEndpoint.java
>
>    public Exchange createKafkaExchange(MessageAndMetadata<byte[], byte[]>
> mm) {
>         Exchange exchange = new DefaultExchange(getCamelContext(),
> getExchangePattern());
>
> I believe this should be instantiated as
> Exchange exchange = new DefaultExchange(this, getExchangePattern());
>
>
> -rahul



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/