Create Messages
As described in Jakarta Messaging Message Bodies , EMS works with the following types of messages:
- Messages with no body
- Text Messages
- Map Messages
- Bytes Messages
- Stream Messages
- Object Messages
There is a separate create method for each type of message.
The following examples show how to create a simple text message containing the string "Hello."
- Java
Use the
Session
object’screateTextMessage()
method to create aTextMessage
:TextMessage message = session.createTextMessage("Hello");
See the
tibjmsMsgProducer.java
sample client for a working example. - C
Use the
tibemsTextMsg_Create
function to create a text message of typetibemsTextMsg
:tibemsTextMsg message = "Hello";
status = tibemsTextMsg_Create(&message);
See the
tibemsMsgProducer.c
sample client for a working example. - C#
Use the
Session.CreateTextMessage
method to create text message of typeTextMessage
:TextMessage message = session.CreateTextMessage("Hello");
See the
csMsgProducer.cs
sample client for a working example.