Dynamic compression can be enabled on the JMS connection factory. Here you specify a threshold in bytes. If the serialized message body exceeds this threshold and if the client is not collocated then the message payload is compressed in-flight. See Compressing Messages in the WebLogic Performance and Tuning Guide.
An alternative is to programmatically set a compression threshold via