Skip to content

Instantly share code, notes, and snippets.

@rofr
Created October 18, 2013 14:42
Show Gist options
  • Save rofr/7042574 to your computer and use it in GitHub Desktop.
Save rofr/7042574 to your computer and use it in GitHub Desktop.
Passing test confirming null selector doesn't block messages and that nolocal means local either to the connection or session objects.
[TestMethod]
public void separate_client_in_same_process_receives_message_using_null_selector_and_ignoring_local_messages()
{
var topic = Guid.NewGuid().ToString();
var host = "tcp://localhost:61616";
var topicClient1 = new ActiveMqTopicClient(topic, host, ignoreLocal: true);
var topicClient2 = new ActiveMqTopicClient(topic, host, ignoreLocal: true);
var eventsRecieved = 0;
var waitHandle = new ManualResetEvent(initialState: false);
//ignoreLocalMessages :false orsakar rundgång mellan interna och externa bussen
//vi är bara
topicClient2.MessageReceived += message =>
{
eventsRecieved++;
waitHandle.Set();
};
topicClient1.Send(new ActiveMQObjectMessage(){ Body = new object()});
waitHandle.WaitOne(TimeSpan.FromSeconds(2));
Assert.AreEqual(1, eventsRecieved);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment