case MAP:
jmsMessage = jmsProducerSession.createMapMessage();
for (Property mapItem : mapBodyItems) {
Type propertyType = mapItem.getType();
switch (propertyType) {
case BOOLEAN:
((MapMessage) jmsMessage).setBoolean(mapItem.getName(), Boolean.valueOf(mapItem.getValue()));
break;
case BYTE:
((MapMessage) jmsMessage).setByte(mapItem.getName(), Byte.valueOf(mapItem.getValue()));
break;
case CHAR:
((MapMessage) jmsMessage).setChar(mapItem.getName(), mapItem.getValue().charAt(0));
break;
case DATE_TIME:
((MapMessage) jmsMessage).setString(mapItem.getName(), mapItem.getValue());
break;
case DOUBLE:
((MapMessage) jmsMessage).setDouble(mapItem.getName(), Double.valueOf(mapItem.getValue()));
break;
case FLOAT:
((MapMessage) jmsMessage).setFloat(mapItem.getName(), Float.valueOf(mapItem.getValue()));
break;
case INT:
((MapMessage) jmsMessage).setInt(mapItem.getName(), Integer.valueOf(mapItem.getValue()));
break;
case LONG:
((MapMessage) jmsMessage).setLong(mapItem.getName(), Long.valueOf(mapItem.getValue()));
break;
case OBJECT:
((MapMessage) jmsMessage).setString(mapItem.getName(), mapItem.getValue());
break;
case SHORT:
((MapMessage) jmsMessage).setShort(mapItem.getName(), Short.valueOf(mapItem.getValue()));
break;
case STRING:
((MapMessage) jmsMessage).setString(mapItem.getName(), mapItem.getValue());
break;
default:
throw new UnsupportedOperationException("Map message body item type not supported: " + propertyType);
}
}
break;
case BYTES:
jmsMessage = jmsProducerSession.createBytesMessage();
((BytesMessage) jmsMessage).writeBytes(byteBody);
break;
case STREAM:
jmsMessage = jmsProducerSession.createStreamMessage();
((StreamMessage) jmsMessage).writeBytes(byteBody);
break;
default:
throw new UnsupportedOperationException("Message Type not supported: " + type);
}
jmsMessage.setJMSType(messageToSend.getDestinationJmsType());
jmsMessage.setJMSMessageID(messageId);
// fill jms properties
for (Property property : messageToSend.getPropertyList()) {
Type propertyType = property.getType();
switch (propertyType) {
case BOOLEAN:
jmsMessage.setBooleanProperty(property.getName(), Boolean.valueOf(property.getValue()));
break;