@Override public HazelcastMQMessage toMessage(Object msgData) throws HazelcastMQException { try { return doToMessage((byte[]) msgData); } catch (IOException ex) { throw new HazelcastMQException( "IO error converting message bytes to a message.", ex); } }
@Override public Object fromMessage(HazelcastMQMessage message) throws HazelcastMQException { try { return doFromMessage(message); } catch (IOException ex) { throw new HazelcastMQException( "IO error converting message to message bytes.", ex); } }
@Override public void send(HazelcastMQMessage msg, long timeToLive) { if (destination == null) { throw new HazelcastMQException( "No destination configured for the producer."); } doSend(destination, msg, timeToLive); }
@Override public void send(String destination, HazelcastMQMessage msg, long timeToLive) { if (this.destination != null) { throw new HazelcastMQException( "Cannot override producer specified destination."); } doSend(destination, msg, timeToLive); }
throw new HazelcastMQException(format( "Invalid HazelcastMQ message. The message must " + "start with %s command.", MESSAGE_COMMAND)); throw new HazelcastMQException( "Invalid Hazelcast JMS message. The message must " + "end with NULL_CHARACTER.");
throw new HazelcastMQException("Destination is required when " + "sending a message."); throw new HazelcastMQException(format( "Failed to send to queue destination [%s]. Queue is full.", destination)); throw new HazelcastMQException(format( "Destination cannot be resolved [%s].", destination));
throw new HazelcastMQException(format( "Destination cannot be resolved [%s].", destination));