[ 
https://issues.apache.org/jira/browse/IGNITE-3727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15448883#comment-15448883
 ] 

Yujue Li commented on IGNITE-3727:
----------------------------------

package msg_async_test;

import java.util.UUID;

import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteMessaging;
import org.apache.ignite.Ignition;
import org.apache.ignite.lang.IgniteBiPredicate;

public class IgniteMsgAsyncTest {

        public static void main(String[] args) {
                // TODO Auto-generated method stub

                try(Ignite ignite = Ignition.start()){
                        IgniteMessaging msg = ignite.message().withAsync();
                        
                        msg.remoteListen("Topic", new IgniteBiPredicate<UUID, 
String>() {
                            @Override public boolean apply(UUID nodeId, String 
msg) {
                                try {
                                                
Thread.currentThread().sleep(2000);
                                        } catch (InterruptedException e) {
                                                // TODO Auto-generated catch 
block
                                                e.printStackTrace();
                                        }
                                System.out.println("Received message [msg=" + 
msg + ", from=" + nodeId + ']');
                                return true; // Return true to continue 
listening.
                            }
                        });
                        
                        for (int i = 0; i < 5; i++){
                            msg.send("Topic", Integer.toString(i));
                            System.out.println("MSG:" + i);
                        }
                }       
        }
}

this small program work in sync mode.
after msg.send() method executed,current thread is blocked.

> ignite.message() method not support async mode,withAsync() is invalid.
> ----------------------------------------------------------------------
>
>                 Key: IGNITE-3727
>                 URL: https://issues.apache.org/jira/browse/IGNITE-3727
>             Project: Ignite
>          Issue Type: Bug
>          Components: messaging
>    Affects Versions: 1.7
>         Environment: windows 7
>            Reporter: Yujue Li
>            Assignee: Dmitriy Govorukhin
>            Priority: Blocker
>             Fix For: 1.8
>
>
> ignite.message() method not support async mode,withAsync() is invalid.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to