public AmqpChannel publishBasic ( ByteBuffer body , AmqpProperties properties , String exchange , String routingKey , boolean mandatory , boolean immediate ) { @ SuppressWarnings ( "unchecked" ) Map < String , Object > amqpProps = ( Map < String , Object > ) Collections . EMPTY_MAP ; if ( properties != null ) { amqpProps = properties . getProperties ( ) ; } HashMap < String , Object > props = ( HashMap < String , Object > ) amqpProps ; return publishBasic ( body , props , exchange , routingKey , mandatory , immediate ) ; }
This method publishes a message to a specific exchange . The message will be routed to queues as defined by the exchange configuration and distributed to any active consumers when the transaction if any is committed .