IBM MQ v8 Knowledge center documents how to set MQMD properties with IBM MQ Classes for JMS in the page "Reading and writing the message descriptor from an IBM MQ classes for JMS application"
You must set the Destination object property WMQ_MQMD_WRITE_ENABLED to true for the setting of MQMD properties to have any effect. You can then use the property setting methods of the message (for example setStringProperty) to assign values to the MQMD fields. All MQMD fields are exposed except StrucId and Version; BackoutCount can be read but not written to.
// Enable MQMD write
dest.setBooleanProperty(WMQConstants.WMQ_MQMD_WRITE_ENABLED, true);
The IBM MQ v8 Knowledge center page "JMS message object properties" documents the properties that can set be set.
I am a IBM MQ admin and not versed in Apache Camel, but I found this StackOverflow post "How to set ApplicationIdData using MQQueueConnectionFactory?" helpful along with the Apache Camel Documentation on "Simple Expression Language"
For example to set a header as a boolean type you can do:
.setHeader("cool", simple("true", Boolean.class))
Based on the above information you just need to add one additional line to allow you to set the JMS_IBM_MQMD_MsgId peroperty:
exchange.getIn().setHeader("mdWriteEnabled", simple("true", Boolean.class))
exchange.getIn().setHeader("JMS_IBM_MQMD_MsgId",MsgExtFileName().getBytes())
exchange.getIn().setHeader("JMS_IBM_Format", MQC.MQFMT_STRING)
NOTE based on some other info I found the setHeader above may not be correct and you may need to append it to the end of your Queue destination URI:
queue:///QueueName?mdWriteEnabled=true
Note that the messageId in the IBM MQ MQMD is represented as 24 bytes. This not not converted when passed from platform to platform, if you are using normal alpha numeric characters this should not be a problem even going from UTF-8 to ASCII since the byte values are the same, but it is something to be aware of.
For more information on messageId and character sets reference these two StackOverflow answers:
Get MQ messageId in string format
CCSID on MQ Managers on different platforms