Sending and receiving messages from a queue

Using the built-in functions msgsend and msgrecv, Transact-SQL applications can send messages to a queue, or read messages from a queue in JMS and MQ.

You can use application logic to construct a message body or payload, or the body may be constructed from character or binary data directly from relational tables.

You can construct the values of message properties (header or user properties) from relational data or from application logic, and include the constructed message properties in the message you are sending.

Messages read from the JMS or MQ queue can be processed by the application logic, or directly inserted into relational tables.To filter out only messages of interest when executing the read operation, specify a message selector.

Message properties in read messages can be individually processed by the application logic. For more information about message properties, see msgsend.