When you have created a connection definition, you need to create a remote definition of a local queue on queue manager QM2.
mqe_script_sproxyq -create -qname Q2 -destination QM2
This command creates a synchronous proxy queue, which is a remote definition of a local queue on QM2. It is not necessary for QM2 to exist when the remote queue definition is created. However, you must create a connection definition (see 4. Create a connection definition) before you can create this remote queue definition.
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.