AkkaSocketFactory implements SocketFactory { @Override public Socket createConsumerSocket(Context context, ZeromqSocketType socketType) { LOGGER.debug("Creating consumer socket [{}]", socketType); Socket socket; switch (socketType) { default: throw new ZeromqException("Unsupported socket type for consumer: " + this); case ROUTER: socket = context.socket(ZMQ.ROUTER); break; case SUBSCRIBE: socket = context.socket(ZMQ.SUB); break; case PULL: socket = context.socket(ZMQ.PULL); break; } applySocketOptions(socket); return socket; } AkkaSocketFactory(long highWaterMark, long linger); @Override Socket createConsumerSocket(Context context, ZeromqSocketType socketType); @Override Socket createProducerSocket(Context context, ZeromqSocketType socketType);  }
@Test(expected = ZeromqException.class) public void publishIsProducer() { new AkkaSocketFactory(0, 0).createConsumerSocket(null, ZeromqSocketType.PUBLISH); }
@Test(expected = ZeromqException.class) public void pushIsProducer() { new AkkaSocketFactory(0, 0).createConsumerSocket(null, ZeromqSocketType.PUSH); }