When you have created a connection definition, you need to create a remote definition of a local queue on queue manager QM1.
mqe_script_sproxyq -create -qname Q1 -destination QM1
This command creates a synchronous proxy queue, which is a remote definition of a local queue on QM1. It is not necessary for QM1 to exist when the remote queue definition is created, but it must exist before a message is put to it.
For more information on using Java or C to create a remote queue definition, see Configuring remote queues. For examples in Java™ and C, see Java and C.