public void stop ( String destName ) throws MessagingException { try { // Look for an existing destination for the given destination // JMSDestination jmsDest = jmsDestinations . get ( destName ) ; if ( jmsDest != null ) { // Close out all JMS related state // if ( jmsDest . producer != null ) { jmsDest . producer . close ( ) ; logger . debug ( "Closed producer for " + destName ) ; } if ( jmsDest . consumer != null ) { jmsDest . consumer . close ( ) ; logger . debug ( "Closed consumer for " + destName ) ; } if ( jmsDest . session != null ) { jmsDest . session . close ( ) ; logger . debug ( "Closed session for " + destName ) ; } jmsDest . destination = null ; jmsDest . session = null ; jmsDest . producer = null ; jmsDest . consumer = null ; // Remove the JMS client entry // jmsDestinations . remove ( destName ) ; jmsDest = null ; } } catch ( JMSException e ) { throw new MessagingException ( e . getMessage ( ) , e ) ; } }
Stops producers and consumers on a given destination . This has no effect on durable subscriptions .