[infinispan-dev] mux usage

Ales Justin ales.justin at gmail.com
Mon May 14 17:26:29 EDT 2012


Could be that I don't fully understand how this mux stuff should work. :-)
As we've been busting heads since Friday ... 

This is the code (see below) that sets up dispatcher, and sets the listener.

As you can see I add the msg listener to dispatcher.
And I use dispatcher's ::getProtocolAdapter to setup UpHandler for mux_id.

I then expect the following:
* slave tries sending the msg to master
* this dispatcher adds mux_id / scopeId to the msg
* on master, dispatcher's msg listener should pick up this msg

The problem is that our msg listener is never hit,
meaning no slave msgs are ever received.

Any idea what we're doing wrong or what's missing?

-Ales

---

        UpHandler handler = channel.getUpHandler();
        if (handler instanceof Muxer) {
            Short n = (Short) props.get(MUX_ID);
            if (n == null) {
                throw new IllegalArgumentException("Missing mux id!");
            }
            @SuppressWarnings("unchecked")
            Muxer<UpHandler> muxer = (Muxer<UpHandler>) handler;
            if (muxer.get(n) != null) {
                throw new IllegalArgumentException("Muxer with id " + n + " already used!");
            }

            muxId = n;
            ClassLoader cl = (ClassLoader) props.get(CLASSLOADER);
            MessageListener wrapper = (cl != null) ? new ClassloaderMessageListener(listener, cl) : listener;
            MessageDispatcher dispatcher = new MuxMessageDispatcher(muxId, channel, wrapper, listener, null);
            muxer.add(muxId, dispatcher.getProtocolAdapter());
            sender = new DispatcherMessageSender(dispatcher);




More information about the infinispan-dev mailing list