query if queue exist and get it like getOrCreateCache

classic Classic list List threaded Threaded
6 messages Options
Narsi Reddy Nallamilli Narsi Reddy Nallamilli
Reply | Threaded
Open this post in threaded view
|

query if queue exist and get it like getOrCreateCache

Hi!

I am looking for some method just like getOrCreateCache available for queue. Any help!
Mikael Mikael
Reply | Threaded
Open this post in threaded view
|

Re: query if queue exist and get it like getOrCreateCache

What is wrong with Ignite.queue() ?

queue(String name, int cap, CollectionConfiguration cfg)

Will get a named queue from cache and create one if it has not been created yet and cfg is not null.

Mikael

Den 2019-11-14 kl. 13:02, skrev Narsi Reddy Nallamilli:
Hi!

I am looking for some method just like getOrCreateCache available for queue. Any help!
Narsi Reddy Nallamilli Narsi Reddy Nallamilli
Reply | Threaded
Open this post in threaded view
|

Re: query if queue exist and get it like getOrCreateCache

Hi Mikael,

Do you mean the 4th statement will not create new Queue? and would point to ig
CollectionConfiguration colCfg = new CollectionConfiguration();
colCfg.setCollocated(true);
IgniteQueue<Object> ig = ignite.queue("abc",0,colCfg);
IgniteQueue<Object> ig1 = ignite.queue("abc",0,colCfg);


On Thu, Nov 14, 2019 at 5:42 PM Mikael <[hidden email]> wrote:

What is wrong with Ignite.queue() ?

queue(String name, int cap, CollectionConfiguration cfg)

Will get a named queue from cache and create one if it has not been created yet and cfg is not null.

Mikael

Den 2019-11-14 kl. 13:02, skrev Narsi Reddy Nallamilli:
Hi!

I am looking for some method just like getOrCreateCache available for queue. Any help!
Mikael Mikael
Reply | Threaded
Open this post in threaded view
|

Re: query if queue exist and get it like getOrCreateCache

Hi!

If there is a queue created already with the name "abc" it will just return that queue, if it cannot find it and you have included a configuration it will create it.

Mikael

Den 2019-11-14 kl. 13:30, skrev Narsi Reddy Nallamilli:
Hi Mikael,

Do you mean the 4th statement will not create new Queue? and would point to ig
CollectionConfiguration colCfg = new CollectionConfiguration();
colCfg.setCollocated(true);
IgniteQueue<Object> ig = ignite.queue("abc",0,colCfg);
IgniteQueue<Object> ig1 = ignite.queue("abc",0,colCfg);


On Thu, Nov 14, 2019 at 5:42 PM Mikael <[hidden email]> wrote:

What is wrong with Ignite.queue() ?

queue(String name, int cap, CollectionConfiguration cfg)

Will get a named queue from cache and create one if it has not been created yet and cfg is not null.

Mikael

Den 2019-11-14 kl. 13:02, skrev Narsi Reddy Nallamilli:
Hi!

I am looking for some method just like getOrCreateCache available for queue. Any help!
Narsi Reddy Nallamilli Narsi Reddy Nallamilli
Reply | Threaded
Open this post in threaded view
|

Re: query if queue exist and get it like getOrCreateCache

Thank you Mikael.

On Thu, Nov 14, 2019 at 7:05 PM Mikael <[hidden email]> wrote:

Hi!

If there is a queue created already with the name "abc" it will just return that queue, if it cannot find it and you have included a configuration it will create it.

Mikael

Den 2019-11-14 kl. 13:30, skrev Narsi Reddy Nallamilli:
Hi Mikael,

Do you mean the 4th statement will not create new Queue? and would point to ig
CollectionConfiguration colCfg = new CollectionConfiguration();
colCfg.setCollocated(true);
IgniteQueue<Object> ig = ignite.queue("abc",0,colCfg);
IgniteQueue<Object> ig1 = ignite.queue("abc",0,colCfg);


On Thu, Nov 14, 2019 at 5:42 PM Mikael <[hidden email]> wrote:

What is wrong with Ignite.queue() ?

queue(String name, int cap, CollectionConfiguration cfg)

Will get a named queue from cache and create one if it has not been created yet and cfg is not null.

Mikael

Den 2019-11-14 kl. 13:02, skrev Narsi Reddy Nallamilli:
Hi!

I am looking for some method just like getOrCreateCache available for queue. Any help!
Alexandr Shapkin Alexandr Shapkin
Reply | Threaded
Open this post in threaded view
|

RE: Re: query if queue exist and get it like getOrCreateCache

Yes, that true in most cases unless you try to call the queue method with a different collection configuration.

In such case, an exception will be thrown.

 

From: [hidden email]
Sent: Friday, November 15, 2019 10:47 AM
To: [hidden email]
Subject: Re: query if queue exist and get it like getOrCreateCache

 

Thank you Mikael.

 

On Thu, Nov 14, 2019 at 7:05 PM Mikael <[hidden email]> wrote:

Hi!

If there is a queue created already with the name "abc" it will just return that queue, if it cannot find it and you have included a configuration it will create it.

Mikael

Den 2019-11-14 kl. 13:30, skrev Narsi Reddy Nallamilli:

Hi Mikael,

 

Do you mean the 4th statement will not create new Queue? and would point to ig

CollectionConfiguration colCfg = new CollectionConfiguration();
colCfg.setCollocated(true);
IgniteQueue<Object> ig = ignite.queue("abc",0,colCfg);
IgniteQueue<Object> ig1 = ignite.queue("abc",0,colCfg);

 

 

On Thu, Nov 14, 2019 at 5:42 PM Mikael <[hidden email]> wrote:

What is wrong with Ignite.queue() ?

queue(String name, int cap, CollectionConfiguration cfg)

Will get a named queue from cache and create one if it has not been created yet and cfg is not null.

 

Mikael

 

Den 2019-11-14 kl. 13:02, skrev Narsi Reddy Nallamilli:

Hi!

 

I am looking for some method just like getOrCreateCache available for queue. Any help!

 

Alex Shapkin