Assuming you don't have many producers sending to the same destination, your producer could connect to the broker via JMX and query the MemoryPercentUsage property of the destination. If that is above 70% you might skip the creation of the msg. So JMX does expose this information. Other than that I am not sure there is an alternative way.
Torsten Mielke FuseSource tmielke.blogspot.con