You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by "Edward S." <se...@gmail.com> on 2017/09/11 17:42:33 UTC
Existing queue can't be accessed on client node
Hi.
I have a server node that creates an IgniteQueue:
ignite.queue("queueName", 0, new CollectionConfiguration());
Client node tries to receive queue:
IgniteConfiguration.setClientMode(true);
IgniteQueue queueOnClientNode = ignite.queue("queueName", 0, null);
queueOnClientNode is always null.
This happened in version 2.1.
In version 1.9 all work fine.
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Existing queue can't be accessed on client node
Posted by Mikhail <mi...@gmail.com>.
Hi again,
I filed a bug about the issue you described:
https://issues.apache.org/jira/browse/IGNITE-6437
Thanks,
Mike.
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Existing queue can't be accessed on client node
Posted by "Edward S." <se...@gmail.com>.
When we use null instead of CollectionConfiguration we expect to get an
existing queue.
Same issue was described here:
http://apache-ignite-users.70518.x6.nabble.com/Can-client-node-use-IgniteQueue-tp508.html
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Existing queue can't be accessed on client node
Posted by vsuslov <rs...@gmail.com>.
I had the same situation when I use null instead of CollectionConfiguration
on client node.
I have tried to use a CollectionConfiguration like on server nodes and it
worked.
Maybe I use it wrong way but it works.
-----
---------------
Best regards,
Suslov Vadim
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Existing queue can't be accessed on client node
Posted by Mikhail <mi...@gmail.com>.
Hi Edward,
Thank you for the code snippet, I was able to reproduce the issue.
I need time to investigate it, if there's no problem with the code, I'll
file the issue to Ignite's jira to fix it.
Thanks,
Mike.
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Existing queue can't be accessed on client node
Posted by "Edward S." <se...@gmail.com>.
Hi Mikhail,
I prepared small example to illustrate the problem.
I start Ignite server node on local computer(Win 7), then run this example.
Servrer's output is
Ignite Command Line Startup, ver. 2.1.0#20170720-sha1:a6ca5c8a
2017 Copyright(C) Apache Software Foundation
....
>>>>>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>>Queue is created. Queue name is 558de1d5-a737-47fe-b836-2167ad7deaf9
On the client:
ver. 2.1.0#20170720-sha1:a6ca5c8a
2017 Copyright(C) Apache Software Foundation
Try to get queue. Queue name is 558de1d5-a737-47fe-b836-2167ad7deaf9
Queue is null on client.
Source code is:
import java.util.UUID;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteException;
import org.apache.ignite.IgniteQueue;
import org.apache.ignite.Ignition;
import org.apache.ignite.configuration.CollectionConfiguration;
import org.apache.ignite.lang.IgniteRunnable;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
public class IgniteQueueExample {
public static void main(String[] args) throws Exception {
Ignition.setClientMode(true);
try (Ignite ignite =
Ignition.start("examples/config/example-ignite.xml")) {
System.out.println();
System.out.println(">>> Ignite queue example started.");
// Make queue name.
String queueName = UUID.randomUUID().toString();
initializeQueue(ignite, queueName);
System.out.println("Try to get queue. Queue name is " +
queueName);
IgniteQueue<String> queue = ignite.queue(queueName, 0, null);
if(queue==null){
System.out.println("Queue is null on client.");
}
}
System.out.println("Cache queue example finished.");
}
private static void initializeQueue(Ignite ignite, String queueName)
throws IgniteException {
ignite.compute(ignite.cluster().forServers()).broadcast(new
QueueCreateClosure(queueName));
}
@SuppressWarnings("serial")
private static class QueueCreateClosure implements IgniteRunnable {
/** Queue name. */
private final String queueName;
QueueCreateClosure(String queueName) {
this.queueName = queueName;
}
@Override public void run() {
System.out.println(">>>>>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
CollectionConfiguration colCfg = new
CollectionConfiguration();
colCfg.setCacheMode(PARTITIONED);
IgniteQueue<String> queue = Ignition.ignite().queue(queueName,
0, colCfg);
if(queue==null){
System.out.println(">>Queue is null.");
}else{
System.out.println(">>Queue is created. Queue name is " +
queue.name());
}
}
}
}
Hi Edward,
I can't reproduce the problem, could you please share a working code
snippet
that will show the problem?
Thanks,
Mikhail.
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Existing queue can't be accessed on client node
Posted by Mikhail <mi...@gmail.com>.
Hi Edward,
I can't reproduce the problem, could you please share a working code snippet
that will show the problem?
Thanks,
Mikhail.
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/