@Override
    public MessageProducer createProducer(Destination destination) throws JMSException {
        checkClosed();
        if (destination != null && !(destination instanceof SQSQueueDestination)) {
            throw new JMSException("Actual type of Destination/Queue has to be SQSQueueDestination");
        }
        SQSMessageProducer messageProducer;
        synchronized (stateLock) {
            checkClosing();
            messageProducer = new SQSMessageProducer(amazonSQSClient, this, (SQSQueueDestination) destination);
            messageProducers.add(messageProducer);
        }
        return messageProducer;
    }
@ Override public MessageProducer createProducer ( Destination destination ) throws JMSException { checkClosed ( ) ; if ( destination != null && ! ( destination instanceof SQSQueueDestination ) ) { throw new JMSException ( "Actual type of Destination/Queue has to be SQSQueueDestination" ) ; } SQSMessageProducer messageProducer ; synchronized ( stateLock ) { checkClosing ( ) ; messageProducer = new SQSMessageProducer ( amazonSQSClient , this , ( SQSQueueDestination ) destination ) ; messageProducers . add ( messageProducer ) ; } return messageProducer ; }
Creates a <code>MessageProducer</code> for the specified destination.
Only queue destinations are supported at this time.

@param destination
a queue destination
@return new message producer
@throws JMSException
If session is closed or queue destination is not used