JMS Destination Types

JMS binding destinations can be configured as physical destination names or as JNDI destination names.

The spring.cloud.stream.jms.bindings.<binding_name>.<consumer | producer>.destination-type binding property specifies whether the destination value is a physical destination name or a JNDI destination name.

Destination Type Destination JNDI Lookup?

queue

No

topic

No

unknown (default)

Yes

When destination-type is either queue or topic, the configured destination is assumed to be a physical destination name and no JNDI lookup is done.

When destination-type is unknown, the configured destination is assumed to be a JNDI destination name and a lookup is performed. A JNDI Context must be configured for the lookup to succeed.

In the following example, the consumer’s destination is known at configuration time and no JNDI lookup is performed:

spring: 
  cloud:
    stream:
      bindings:
        input-0:
          destination: physical_queue_name 
          binder: jms
      jms:
        bindings: 
          input-0:
            consumer:
              destination-type: queue       

In the following example, the producer’s destination is only known at runtime after a successful JNDI lookup:

spring: 
  cloud:
    stream: 
      bindings:
        output-1:
          destination: jndi_destination_name 
          binder: jms
      jms:
        bindings:
          output-1:
            producer:
              destination-type:unknown     

A JNDI Context must be configured for the lookup to succeed.