    Context myContext = new InitialContext();

    Queue stockQueue = (Queue) myContext.lookup("StockQueue");
    QueueConnectionFactory myFactory =
            (QueueConnectionFactory)myContext.lookup("MyProvider");
    QueueConnection myConnection = myFactory.createQueueConnection();
    QueueSession mySession =
            myConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
    QueueSender mySender = mySession.createSender(stockQueue);

    MapMessage stockQuote = mySession.createMapMessage();
    stockQuote.setString("Name",  stockName);
    stockQuote.setDouble("Value", stockValue);

    mySender.send(stockQuote);