You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by arunkjn <ar...@gmail.com> on 2017/11/13 12:12:49 UTC

Use IgniteQueue in client

Hi,

I want to create an IgniteQueue on a server node and get a reference to this
queue on a client node. I get a null pointer exception on client when I do
this.

This has been asked before in a very old thread and is reportedly fixed as
per  this issue <https://issues.apache.org/jira/browse/IGNITE-1026>  . But I
am getting the same behaviour using both ignite version 2.2 and 2.3 . Can
someone aware of the development in this regard please update me with the
status of this? Is this a reasonable expectation? Or are there other ways to
achieve this?

Thanks,
Arun



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Use IgniteQueue in client

Posted by arunkjn <ar...@gmail.com>.
Thanks Alexey.

I think the problem is that Ignite.queue and Ignite.set javadocs mention
that null is an acceptable entry and also suggest that null can be used when
we do not want to create a new set or queue. 



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Use IgniteQueue in client

Posted by Alexey Kukushkin <ku...@gmail.com>.
Created https://issues.apache.org/jira/browse/IGNITE-6889 (ignite.queue()
returns null when queue configuration is null)

Re: Use IgniteQueue in client

Posted by Alexey Kukushkin <ku...@gmail.com>.
Hi,

Two things:

   1. You must use same configuration (limit and CollectionConfiguration)
   on both client and server
   2. You cannot pass "null" as CollectionConfiguration. Pass empty
   CollectionConfiguration (new CollectionConfiguration()) if you have no
   specific settings.

This code must work (just tried a queue sample):

Server:
IgniteQueue<String> q = ignite.queue("MyQueue", 10, new
CollectionConfiguration());

Client:
IgniteQueue<String> q = ignite.queue("MyQueue", 10, new
CollectionConfiguration());


I do see a usability issue here that we cannot specify null as a collection
configuration. I will open a bug.

Re: Use IgniteQueue in client

Posted by arunkjn <ar...@gmail.com>.
Hi Evgeniy, 

The ticket mentioned by you says that the dataset can not be obtained on
client if it is created on server node regardless of any condition. Here, as
I understand if I pass empty configuration as third parameter I will get a
reference of queue in client. Is it not true? If it is then these should
probably be treated as two different issues?

thanks


Evgeniy Stanilovskiy wrote
> ticket https://issues.apache.org/jira/browse/IGNITE-6437 already created





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Use IgniteQueue in client

Posted by Evgeniy Stanilovskiy <es...@gridgain.com>.
ticket https://issues.apache.org/jira/browse/IGNITE-6437 already created

> Hi,
>
> I want to create an IgniteQueue on a server node and get a reference to  
> this
> queue on a client node. I get a null pointer exception on client when I  
> do
> this.
>
> This has been asked before in a very old thread and is reportedly fixed  
> as
> per  this issue <https://issues.apache.org/jira/browse/IGNITE-1026>  .  
> But I
> am getting the same behaviour using both ignite version 2.2 and 2.3 . Can
> someone aware of the development in this regard please update me with the
> status of this? Is this a reasonable expectation? Or are there other  
> ways to
> achieve this?
>
> Thanks,
> Arun
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/