To build, package, deploy, and run the MessageBrowser example using NetBeans IDE, follow these steps.
You also need the Producer example to send the message to the queue, and one of the consumer clients to consume the messages after you inspect them. If you did not do so already, package these examples.
In NetBeans IDE, select File->Open Project.
In the Open Project dialog, navigate to:
tut-install/examples/jms/simple/ |
Select the messagebrowser folder.
Select the Open as Main Project check box.
Click Open Project.
In the Projects tab, right-click the project and select Build.
Run the Producer client, sending one message to the queue:
Right-click the producer project and select Properties.
Select Run from the Categories tree.
In the Arguments field, type the following:
queue |
Click OK.
Right-click the project and select Run.
The output of the client looks like this:
Destination type is queue Sending message: This is message 1 from producer |
Run the MessageBrowser client. Right-click the messagebrowser project and select Run.
The output of the client looks like this:
Message: Text: This is message 1 from producer Class: com.sun.messaging.jmq.jmsclient.TextMessageImpl getJMSMessageID(): ID:12-129.148.71.199(8c:34:4a:1a:1b:b8)-40883-1255980521747 getJMSTimestamp(): 1129062957611 getJMSCorrelationID(): null JMSReplyTo: null JMSDestination: PhysicalQueue getJMSDeliveryMode(): PERSISTENT getJMSRedelivered(): false getJMSType(): null getJMSExpiration(): 0 getJMSPriority(): 4 Properties: null Message: Class: com.sun.messaging.jmq.jmsclient.MessageImpl getJMSMessageID(): ID:13-129.148.71.199(8c:34:4a:1a:1b:b8)-40883-1255980521747 getJMSTimestamp(): 1129062957616 getJMSCorrelationID(): null JMSReplyTo: null JMSDestination: PhysicalQueue getJMSDeliveryMode(): PERSISTENT getJMSRedelivered(): false getJMSType(): null getJMSExpiration(): 0 getJMSPriority(): 4 Properties: null |
The first message is the TextMessage, and the second is the non-text control message.
Run the SynchConsumer client to consume the messages.
Right-click the synchconsumer project and select Properties.
Select Run from the Categories tree.
In the Arguments field, type the following:
queue |
Click OK.
Right-click the project and select Run.
The output of the client looks like this:
Destination type is queue Reading message: This is message 1 from producer |