Using the Unica Interact Inbound Gateway for IBM Universal Behavior Exchange

To use the Unica Interact Inbound Gateway for IBM Universal Behavior Exchange, you must create an endpoint and event in UBX system, configure Interact, and configure a UBX subscriber endpoint.

Use the following configurations as an example for your configuration.

A. Creating an endpoint and event in UBX

This is a sample endpoint and event that you can use as an example.

Use the following steps to create an endpoint and event in UBX.
  1. Use the REST API client to post the requests to UBX.
  2. Register an endpoint in UBX with JSON. See the following example.
    Method Call: PUT
    URL: https://ubx-qa1-api.adm01.com/v1/endpoint
    Headers: Content-Type: application/json
    Accept-Charset: UTF-8
    Authorization: Bearer 912586bf-190d-48f9-8488-26f1bf532ef3
    (Note: This is the Auth Key generated from the UBX UI.)
    Body
    {
    "name":"Interactubxdk1",
    "description":"Interactubxdk1",
    "providerName":"IBM", "
    "url":"http://Host:port/ubxEndPoint/UBXEndPoint",
    "endpointTypes":{
    "event":{
    "source":{
    "enabled":true
    },
    "destination":{
    "enabled":true,
    "url":"http://Host:port/ubxEndPoint/UBXEndPoint",
    "destinationType":"push"
    }
    }
    },
    "marketingDatabasesDefinition":{
    "marketingDatabases":[
    {
    "name":"IDSync",
    "identifiers":[
    {
    "name":"interactprofileid",
    "type":"INTERACTID"
    }
    ]
    }
    ]
    }}
    
  3. Register an eventtype in UBX with JSON. See the following example.
    Event Registration for Interact Event in UBX
    Method Call: POST
    URL: https://ubx-qa1-api.adm01.com/v1/eventtype
    Headers:
    Content-Type: application/json
    Accept-Charset: UTF-8
    Authorization: Bearer 912586bf-190d-48f9-8488-26f1bf532ef3
    Note: This is the Auth Key generated from the UBX UI.)
    Bearer 912586bf-190d-48f9-8488-26f1bf532ef3
    Body
    {
    "name": "recommendedOffers",
    "description": "recommended offers by OMO",
    "code": "recommendedOffers"
    }
    
  4. Post an event to UBX with JSON. See the following example.
    
    {
    "channel" : "mobile",
    "identifiers" : [
    {
    "name" : "interactprofileid",
    "value" : "55"
    }
    ],
    "events" : [
    {
    "code" : "recommendedOffers",
    "timestamp" : "2015-12-28T20:16:12Z"
    }
    ]
    }
    

B. Configuring Unica Interact for the Unica Interact Inbound Gateway for IBM Universal Behavior Exchange

Use the following steps to configure Unica Interact.

  1. In the Interact | activityOrceshtrator | receivers configuration property, add a new receiver. Set Type to Kafka or Custom. If you choose Custom, enter ClassName and ClassPath. If you choose Kafka, leave ClassPath and ClassName blank.
  2. Add providerUrl, topic, authentication, group.id, and zookeeper.connect parameters for your receiver.
  3. In the Interact | activityOrceshtrator | gateways configuration property, UBX category is available by default.
    • Using properties files based mappings.
      • Create a new folder, example, Interactubx12 folder under the <Interact_Home>\conf\inbound\UBX directory and copy the properties files to this new folder. The folder name much match the name of the subscriber endpoint that you created in UBX.
      • Configure the interactEventNameMapping.properties file.

        Use this file to map the value of the payload event field that is defined in the interactEventPayloadMapping.properties file as [EventName] to the Interact event name. The interactEventNameMapping.properties file is in the <Install dir>\conf\inbound\UBX directory.{UBX event name}={Interact event name} Example: recommendedOffers=recommendedOffers

        If support for payload data from specific source is necessary, this file may also be placed in the <Install dir>\conf\inbound\UBX\{source} directory. The value for source should match the value of source field in the UniversalBehavior Exchange event payload, typically the Universal Behavior Exchange endpoint name. If support fordata using specific versions is necessary, this file may also be placed in the <Install dir>\conf\inbound\UBX\{source}\version-{version} directory. The value for version must match the value of version field in the Universal Behavior Exchange event payload.

        To support multiple Universal Behavior Exchange instance data, this file may also be placed in the <Install dir>\conf\inbound\UBX\{source}\version-{version}\account-{clientID} directory. The value for clientID must match the value of clientID in the Universal Behavior Exchange event payload

      • Configure the interactEventPayloadMapping.properties file, add your field definitions.

        Use the interactEventPayloadMapping.properties file to map the inbound field to the Interact API parameters. The interactEventPayloadMapping.properties file is in the <Install dir>\conf\inbound\UBX directory.

        Interact API parameters: The value must start with a field type definition, followed by either a static value when the value is in double quotes, or a field name from the payload data. (FIELD_TYPE)"STATIC_VALUE" or (FIELD_TYPE)PAYLOAD_FIELD_NAME. FIELD_TYPE can be either String, Numeric, or DateTime.

        For example:

        [SessionID]=(String)interactprofileid
        [EventName]=(String)code
        [AudienceIDFieldNames]=(String)"change_me"
        [AudienceIDFieldValues]=(String)interactprofileid
        [AudienceLevel]=(String)"change_me"
        [InteractChannel]=(String)"change_me"
        

        Event data: These properties are used to map the event attributes that can be used in your outbound channel communications. The left side contains the variable names you use in your outbound channel communication. The value must start with a field type definition, followed by either a static value when the value is in double quotes, or a field name from the payload data. (FIELD_TYPE)"STATIC_VALUE" or (FIELD_TYPE)PAYLOAD_FIELD_NAME. FIELD_TYPE can be either String, Numeric, or DateTime.

        If support for payload data from specific source is necessary, this file may also be placed in the <Install dir>\conf\inbound\UBX\{source} directory. The value for source should match the value of source field in the Universal Behavior Exchange event payload, typically the Universal Behavior Exchange endpoint name. If support for data using specific versions is required, this file may also be placed in the <Install dir>\conf\inbound\UBX\{source}\version-{version} directory. The value for version must match the value of version field in the Universal Behavior Exchange event payload. To support multiple Universal Behavior Exchange instance data, this file may also be placed in the <Install dir>\conf\inbound\UBX\{source}\version-{version}\account-{clientID} directory. The value for clientID should match the value of clientID in the Universal Behavior Exchange event payload.

      • Restart the Interact server.
      • Create an interactive channel and add an event to it.
    • Using UI based mappings:

      Use Generic Inbound option available under the Gateway tab on Interactive channel. Create gateway with the name 'UBX' and define the event mappings.

      It is required that the incoming request coming from UBX must contain the ICName header parameter. The mappings from the specific Interactive channel will be initialized based on this header value.

  4. Perform the steps mentioned in sections C and D below.
  5. Deploy the interactive channel.
  6. Post an event to UBX from any publisher or to test with a REST API client.

    Example event body:

    
    {  
      "channel" : "mobile",       
      "identifiers" : [            
        {
          "name" : "interactprofileid",       
          "value" : "55"   
        }
      ],
    "events" : [
      {
        "code" : "recommendedOffers",      
        "timestamp" : "2015-12-28T20:16:12Z"
       }
      ]
    }
  7. Check the Unica Interact log to see if the triggered messages event is triggered. You can use this event for further processing in patterns/triggered messaged as per your specific use case

    You can also refer the endpoint logs for more information

C. Configuring the Unica Interact Inbound Gateway for IBM Universal Behavior Exchange endpoint

You must also use the instructions to complete the following configurations.
  • UBX endpoint with Kafka
  • Endpoint ubxInboundEndpoint.properties file
  • Endpoint inboundTopicNameConfig.properties file
  • Endpoint log4j2.xml file

ubxInboundEndpoint.properties file

Use the ubxInboundEndpoint.properties file to configure where to send Universal Behavior Exchange event payload to Unica Interact Inbound Gateway for IBM Universal Behavior Exchange. The ubxInboundEndpoint.properties file is in the <gateway endpoint install dir on the application server> directory.

  • providerURL Required: A list of host or port pairs to be used for establishing the initial connection with the Kafka cluster. This list must be in the form of host1:port1
  • authentication defaults to none – For different authentication modes and its related properties, see the Interact | activityOrchestrator | receivers section.
  • group.id Required - Any string (example: InteractTMGateway)

  • zookeeper.connect Optional - <host>:<port> (example: localhost:2181)

A restart of the gateway endpoint webapp (ubxInboundEndpoint.war) is required in web server or application server

  • UBX endpoint with Kafka
  • Endpoint ubxInboundEndpoint.properties file
  • Endpoint inboundTopicNameConfig.properties file
  • Endpoint log4j.properties file

inboundTopicNameConfig.properties file

The Unica Interact Inbound Gateway for IBM Universal Behavior Exchange endpoint sends the event to Interact by writing to a Kafka Topic. Use the inboundTopicNameConfig.properties file to specify the topic name on which data is published.

Example:

topic=UBXTopic

A restart of gateway endpoint webapp (ubxInboundEndpoint.war) is required in web server or application server for any changes in this file to take effect.

log4j2.xml file

Use the log4j2.xml file to configure different log level for the endpoint. The log4j2.xml file is in the <gateway endpoint install dir on the application server> directory.

Description

Set the log level for com.ibm.web.offerorchestration.inbound.common and com.ibm.web.offerorchestration.inbound.ubx accordingly

D. Deploying the Unica Interact Inbound Gateway for IBM Universal Behavior Exchange and endpoint

  • The Unica Interact inbound gateway war is present at location <Interact_Home>\UBXInboundEndpoint\ubxInboundEndpoint.war.
  • Copy this war file along with conf folder on Unica supported App servers. This server posts data to the Interact inbound Kafka topic to be later consumed by the Unica Interact Inbound Gateway for IBM Universal Behavior Exchange.

The Unica Interact Inbound Gateway for IBM Universal Behavior Exchange endpoint is configured to accept requests from Universal Behavior Exchange and send it to the Unica Interact Inbound Gateway for IBM Universal Behavior Exchange.

You must complete the following tasks to configure the Universal Behavior Exchange Subscriber Gateway endpoint

  1. Configure a new Java system property (-DubxInboundEndpointConfigPath) by editing the configuration file in the web server or in the administrative console of application server.

    The -DubxInboundEndpointConfigPath property must point to the endpoint install directory in the server (i.e conf folder which is copied in the above section).

    This directory contains configuration files for the target Kafka environment and various logging levels for the endpoint. For example -DubxInboundEndpointConfigPath=c: \ubxInboundEndpoint.
  2. Deploy the Unica Interact Inbound Gateway for IBM Universal Behavior Exchange endpoint web archive file (ubxInboundEndpoint.war) from the install directory as described in the web server or application server documentation.

To verify that the endpoint was installed correctly, enter the following address into any browser and look for message

UBX End Point is UP.

http://[Server]:[Port]/[ContextRoot]/UBXEndPoint
Note: You must protect the publicly accessible Unica Interact Inbound Gateway for IBM Universal Behavior Exchange endpoint by adding the required firewall rules to accept http request from IBM Universal Behavior Exchange Server only.

For example, you can use the following instructions to configure and deploy Unica Interact Inbound Gateway for IBM Universal Behavior Exchange endpoint on WebSphere Application Server.

  1. Open the administrative console.
  2. Select Servers > (Expand Server Types) > server_name > (Expand Java™ and Process Management) > Process Definition > Java Virtual Machine.
  3. In the generic JVM arguments, add the property-DubxInboundEndpointConfigPath=<Universal Behavior Exchange Subscriber Gateway endpoint install dir on the application server>. For example, add the property -DubxInboundEndpointConfigPath=C:\ubxInboundEndpoint.
  4. Click OK to save the changes to the master configuration.
  5. Restart the application server.

Deploy the endpoint in WebSphere Application Server

  1. Log in to the administrative console.
  2. Navigate to Applications > Application Types > Websphere enterprise applications. Click Install.
  3. Use the Preparing for the application installation option to locate the endpoint war file (ubxInboundEndpoint.war) to be installed and then click Next.
  4. Click Next in subsequent pages to reach Map context roots for Web modules.
  5. Use the Map context roots for Web modules to locate the Context Root and change value to /UBXEndPoint, this becomes the context root. Click next.
  6. Click Finish.
  7. Once the application finished installing, click Save to keep the changes on the master configuration.
  8. Back in the listed and installed applications, mark the checkbox for ubxInboundEndpoint_war and click Start to load.
Note:

UBXInboundEndpoint is updated to support Kafka by default. UBXInboundEndpoint will be shipped out of the box with Interact.

If you are already using UBXInboundEndpoint with JMS Queue, you can continue using the existing UBXInboundEndpoint war.