psdi.iface.router

Class KafkaHandler

  • All Implemented Interfaces:
    RouterHandler


    public class KafkaHandler
    extends BaseRouterHandler
    MQHandler sends/writes data into a JMS MQ(for example : Websphere MQ). Before using this class, one must make sure that they have correct JNDI setup for Queue Connection Factory and Queue. Also depending on the JMS provider, one has to make sure that their application server classpath contains the necessessary jar files. This Class Implements RouterHandler Interface.
    • Constructor Detail

      • KafkaHandler

        public KafkaHandler()
    • Method Detail

      • invoke

        public byte[] invoke(java.util.Map metaData,
                             byte[] data)
                      throws MXException
        Sends / Writes data to a given Queue. This sendData method looks for two properties namely CON_FACTORY_JNDI_NAME, DEST_QUEUE_JNDI_NAME and its values for a given external system from the MAXEXTSYSHANDLER table. It uses JMSQueueProducer api to write data into a JMS Queue. Note: Before writing into Queue, if you want to compress the message(byte array), then you have to set a property called "ISCOMPRESS" = true in the MAXEXTSYSHANDLER table
        Specified by:
        invoke in interface RouterHandler
        Overrides:
        invoke in class BaseRouterHandler
        Parameters:
        destinationName - Name of the External System
        interfaceName - interfaceName of this transacion
        data - the xml transaction in byte array
        Returns:
        the Bidi transformed data to be collected and used by the descendant classes
        Throws:
        MXException - if there's a problem in writing data to queue.
        See Also:
        RouterHandler.invoke(java.util.Map, byte[])
      • getProperties

        public java.util.List getProperties()
        Returns:
        the List of supported properties.
      • getTopic

        public java.lang.String getTopic()
        looks for CON_FACTORY_JNDI_NAME from the Map and returns the Queue Connection Factory JNDI Name from the map.
        Returns:
        Queue Connection Factory name from the map. If there is no property in the map, it returns 'null'
      • getSecurityProtocol

        public java.lang.String getSecurityProtocol()
        The security protocol for accessing the destination.
        Returns:
        the security protocol
      • getSASLMechanism

        public java.lang.String getSASLMechanism()
        The security protocol for accessing the destination.
        Returns:
        the security protocol
      • getKerberosService

        public java.lang.String getKerberosService()
        The security protocol for accessing the destination.
        Returns:
        the security protocol
      • getKeyTabFile

        public java.lang.String getKeyTabFile()
        The security protocol for accessing the destination.
        Returns:
        the security protocol
      • getKeyTabPrincipal

        public java.lang.String getKeyTabPrincipal()
        The security protocol for accessing the destination.
        Returns:
        the security protocol
      • getUsername

        public java.lang.String getUsername()
        The username for accessing the destination.
        Returns:
        the username