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/

Reply via email to