This is handled transparently by some high-end JMS Servers. For example, Sonic MQ has a JMS client with this type of store and forward capability (I am sure others have similar features).
AFAIK, the JMS implementations that come bundled with
J2EE Servers (such as WebLogic and Websphere) do not have this capability out of the box.