boolean isdirect = ClientRuntime.getRuntime().isEmbeddedBrokerRunning();
if (isdirect) {
//get direct broker instance
ClientRuntimeImpl runtime = (ClientRuntimeImpl) ClientRuntime.getRuntime();
//get direct connection
this.directConnection = runtime.createDirectConnection();
//get inbound q
this.inBoundQ = this.directConnection.getBrokerToClientQueue();
//get outbound q
this.outBoundQ = this.directConnection.getClientToBrokerQueue();