com.ibm.mq.spring.boot

Class MQConfigurationListenerDefault

  • java.lang.Object
    • com.ibm.mq.spring.boot.MQConfigurationListenerDefault
  • All Implemented Interfaces:
    java.util.EventListener, org.springframework.context.ApplicationListener<org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent>


    @ConditionalOnClass(value={org.springframework.boot.autoconfigure.jms.JmsProperties.Listener.class,org.springframework.jms.annotation.JmsListener.class})
     @ConditionalOnMissingBean(value=org.springframework.jms.annotation.JmsListener.class)
    public class MQConfigurationListenerDefault
    extends java.lang.Object
    implements org.springframework.context.ApplicationListener<org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent>
    The default Spring configuration for a JMS Listener sets the receive timeout (a polling loop timer) too low for a cost-effective solution with IBM MQ. See this article for more information. This class will override that default value if it is not explicitly set in the application properties. The application still has control though. If the app sets the value via a call to the listener.setReceiveTimeout method, then that still will be honoured as it comes after the creation and initial attribute setting of the listener object. This method is invoked early in the cycle, once the application environment has been loaded. We then get the opportunity to inspect and add to the environment that will be used later on by the JMS Listener initialisers. This allows the MQ JMS listener to have a different effective default than other JMS providers. Support for this property within Spring Boot itself was added in version 2.2.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void onApplicationEvent(org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent event) 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MQConfigurationListenerDefault

        public MQConfigurationListenerDefault()
    • Method Detail

      • onApplicationEvent

        @Bean
         @Lazy(value=false)
        public void onApplicationEvent(org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent event)
        Specified by:
        onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent>