Class SpringJmsMatsFactoryProducer

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static SpringJmsMatsFactoryWrapper createJmsTxOnlyMatsFactory​(java.lang.String appName, java.lang.String appVersion, io.mats3.serial.MatsSerializer<?> matsSerializer, javax.jms.ConnectionFactory jmsConnectionFactory)
      If you need a MatsFactory that only handles the JMS transactions, this is your factory method - but if you DO make any database calls within any Mats endpoint lambda, you will now have no or poor transactional demarcation, use createSpringDataSourceTxMatsFactory(..) instead.
      static SpringJmsMatsFactoryWrapper createSpringDataSourceTxMatsFactory​(java.lang.String appName, java.lang.String appVersion, io.mats3.serial.MatsSerializer<?> matsSerializer, javax.jms.ConnectionFactory jmsConnectionFactory, javax.sql.DataSource sqlDataSource)
      If you need a MatsFactory employing Spring's DataSourceTransactionManager (which you probably do in a Spring environment utilizing SQL), this is your factory method.
      static SpringJmsMatsFactoryWrapper createSpringPlatformTransactionManagerTxMatsFactory​(java.lang.String appName, java.lang.String appVersion, io.mats3.serial.MatsSerializer<?> matsSerializer, javax.jms.ConnectionFactory jmsConnectionFactory, org.springframework.transaction.PlatformTransactionManager platformTransactionManager)
      If you need a MatsFactory employing a PlatformTransactionManager of your choosing, which you quite possibly want in a Spring environment using e.g.
      • Methods inherited from class java.lang.Object

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

      • SpringJmsMatsFactoryProducer

        public SpringJmsMatsFactoryProducer()
    • Method Detail

      • createSpringDataSourceTxMatsFactory

        public static SpringJmsMatsFactoryWrapper createSpringDataSourceTxMatsFactory​(java.lang.String appName,
                                                                                      java.lang.String appVersion,
                                                                                      io.mats3.serial.MatsSerializer<?> matsSerializer,
                                                                                      javax.jms.ConnectionFactory jmsConnectionFactory,
                                                                                      javax.sql.DataSource sqlDataSource)
        If you need a MatsFactory employing Spring's DataSourceTransactionManager (which you probably do in a Spring environment utilizing SQL), this is your factory method.

        Usage: Make a @Bean-annotated method which returns the result of this method, or employ a Spring FactoryBean where you then need to invoke SpringJmsMatsFactoryWrapper.postConstructForFactoryBean(Environment, ApplicationContext).

        Parameters:
        appName - the containing application's name (for debugging purposes, you'll find it in the trace).
        appVersion - the containing application's version (for debugging purposes, you'll find it in the trace).
        matsSerializer - the JmsMatsFactory utilizes the MatsSerializer, so you need to provide one. (It is probably the one from the 'mats-serial-json' package).
        jmsConnectionFactory - the JMS ConnectionFactory to fetch JMS Connections from, using ConnectionFactory.createConnection(). It is assumed that if username and password is needed, you have configured that on the ConnectionFactory.
        sqlDataSource - the SQL DataSource which to stash into a Spring DataSourceTransactionManager, and from which SQL Connections are fetched from, using DataSource.getConnection(). It is assumed that if username and password is needed, you have configured that on the DataSource.
        Returns:
        the produced SpringJmsMatsFactoryWrapper
      • createSpringPlatformTransactionManagerTxMatsFactory

        public static SpringJmsMatsFactoryWrapper createSpringPlatformTransactionManagerTxMatsFactory​(java.lang.String appName,
                                                                                                      java.lang.String appVersion,
                                                                                                      io.mats3.serial.MatsSerializer<?> matsSerializer,
                                                                                                      javax.jms.ConnectionFactory jmsConnectionFactory,
                                                                                                      org.springframework.transaction.PlatformTransactionManager platformTransactionManager)
        If you need a MatsFactory employing a PlatformTransactionManager of your choosing, which you quite possibly want in a Spring environment using e.g. Spring JDBC or Hibernate, this is your factory method.

        Usage: Make a @Bean-annotated method which returns the result of this method, or employ a Spring FactoryBean where you then need to invoke SpringJmsMatsFactoryWrapper.postConstructForFactoryBean(Environment, ApplicationContext).

        Parameters:
        appName - the containing application's name (for debugging purposes, you'll find it in the trace).
        appVersion - the containing application's version (for debugging purposes, you'll find it in the trace).
        matsSerializer - the JmsMatsFactory utilizes the MatsSerializer, so you need to provide one. (It is probably the one from the 'mats-serial-json' package).
        jmsConnectionFactory - the JMS ConnectionFactory to fetch JMS Connections from, using ConnectionFactory.createConnection(). It is assumed that if username and password is needed, you have configured that on the ConnectionFactory.
        platformTransactionManager - the PlatformTransactionManager (typically DataSourceTransactionManager or HibernateTransactionManager) that the MatsFactory should employ.
        Returns:
        the produced SpringJmsMatsFactoryWrapper
      • createJmsTxOnlyMatsFactory

        public static SpringJmsMatsFactoryWrapper createJmsTxOnlyMatsFactory​(java.lang.String appName,
                                                                             java.lang.String appVersion,
                                                                             io.mats3.serial.MatsSerializer<?> matsSerializer,
                                                                             javax.jms.ConnectionFactory jmsConnectionFactory)
        If you need a MatsFactory that only handles the JMS transactions, this is your factory method - but if you DO make any database calls within any Mats endpoint lambda, you will now have no or poor transactional demarcation, use createSpringDataSourceTxMatsFactory(..) instead.

        Usage: Make a @Bean-annotated method which returns the result of this method, or employ a Spring FactoryBean where you then need to invoke SpringJmsMatsFactoryWrapper.postConstructForFactoryBean(Environment, ApplicationContext).

        Parameters:
        appName - the containing application's name (for debugging purposes, you'll find it in the trace).
        appVersion - the containing application's version (for debugging purposes, you'll find it in the trace).
        matsSerializer - the JmsMatsFactory utilizes the MatsSerializer, so you need to provide one. (It is probably the one from the 'mats-serial-json' package).
        jmsConnectionFactory - the JMS ConnectionFactory to fetch JMS Connections from, using ConnectionFactory.createConnection(). It is assumed that if username and password is needed, you have configured that on the ConnectionFactory.
        Returns:
        the produced SpringJmsMatsFactoryWrapper