7 Replies Latest reply on Mar 12, 2013 12:57 PM by Brian Oliver-Oracle

    Messaging pattern problem in version 2.8.6

    Mauricio Arango-Oracle

      I got the following error when running a basic application to test the Coherence messaging pattern:

      2012-11-27 14:36:53.262/8.836 Oracle Coherence GE <Warning> (thread=Environment.Background.Executor:Thread-2, member=1): An exception occurred when the Queue tried to invoke Message.makeVisibleTo for message MsgId{6-1} and subscription SubscriptionIdentifier{destinationIdentifier=Identifier{test-queue}, subscriberIdentifier=Identifier{0x0000013B435F352D0A00011CFA0E283D61F076068C0F65ABC2A71BC16FEF6C92}}. The message will be delivered to another subscription

      This error occurs on the thread that reads from a queue and messages are never read. The Coherence messaging pattern version used is 2.8.6.
      The program runs fine with no errors when using version 2.8.4.

      The application,based on previous forum postings, has a publisher thread that sets up the queue, starts a subscriber thread and then loops publishing messages;
      the subscriber thread loops reading and printing received messages. Here's the code used:

      package coherence.messaging;

      import java.util.concurrent.Executors;

      import com.oracle.coherence.common.identifiers.Identifier;
      import com.oracle.coherence.patterns.messaging.DefaultMessagingSession;
      import com.oracle.coherence.patterns.messaging.MessagingSession;
      import com.oracle.coherence.patterns.messaging.Subscriber;

      public class MessagingServer {
           private static final String QUEUE= "test-queue";

      public static void main(String[] args) throws InterruptedException {
           System.out.println("Started publisher thread");
           MessagingSession messagingSession = DefaultMessagingSession.getInstance();
           Identifier queueIdentifier = messagingSession.createQueue(QUEUE);
           Executors.newSingleThreadExecutor().submit(new Listener());
           for (int i = 0;; i++) {
                String msg = "messsage-" + i;
                messagingSession.publishMessage(queueIdentifier, msg);
                System.out.println("Sent: " + msg);

      private static class Listener implements Runnable {

           public void run() {
                System.out.println("Started subscriber thread");
                MessagingSession messagingSession = DefaultMessagingSession.getInstance();
                Subscriber subscriber = messagingSession.subscribe(QUEUE);      
                while (true) {
                     try {
                          String msg = (String)subscriber.getMessage();
                          System.out.println("Received: " + msg);
                     catch (Exception e){

      It seems there is an error in version 2.8.4.