Skip to Content
Author's profile photo Lena Larionova

Using Custom Adapters in a Streaming Project: Files and Directories

Creating a custom java toolkit adapter is an easy way to integrate with data sources or destinations that smart data streaming doesn’t provide an ‘out-of-the-box’ adapter for. Developing custom adapters using this toolkit simplifies integration of the adapter into the SAP HANA Streaming Development perspective in HANA studio, as opposed to using a streaming SDK.

We already have a full tutorial on creating a custom toolkit adapter, including everything from creating all the necessary files, to testing the adapter:

Writing a Custom Input Adapter for SAP HANA Smart Data Streaming SPS11

What the tutorial doesn’t cover is where to put some of the custom content that you need to make the adapters work in studio and with the streaming server – .jar files, schema definitions, configuration files, and the like. So, I’ve put together that information below.

Part One: Set up the Custom Toolkit Adapter for Studio

On your local machine, where you have studio installed, you need to update some studio files to include all the necessary information for your custom adapter, and place any new files in the right directories. If the files are missing or don’t contain the right information, your adapter won’t work correctly.

If you created a custom transporter or formatter module:

  • The .jar files relating to your adapter must be in the %STREAMING_HOME%/sybase.cep.studio.native.bins_<plugin-version>\adapters\framework\libj folder
  • The Java class must be added to the custommodulesdefine.xml file in the %STREAMING_HOME%/sybase.cep.studio.native.bins_<plugin-version>\adapters\framework\config folder
  • The schema definitions for any unique parameters must be added to the parametersdefine.xsd file in the %STREAMING_HOME%/sybase.cep.studio.native.bins_<plugin-version>\adapters\framework\config folder

In general:

  • The adapter_config.xml file for the customer adapter must be in the %STREAMING_HOME%/sybase.cep.studio.native.bins_<plugin-version>\adapters\framework\instances\<custom-adapter-name> folder
  • The <custom-adapter-name>.cnxml file must be in the %STREAMING_HOME%/sybase.cep.studio.native.bins_<plugin-version>\lib\adapters folder

The adapter will now show up in studio, but it won’t properly compile in a project until you set up your smart data streaming host for the adapter.

Part Two: Set up the Custom Toolkit Adapter for the Smart Data Streaming Server

The setup for the remote streaming host is very similar to the setup on your local machine.

On the host machine for your smart data streaming installation, go to your $STREAMING_CUSTOM_ADAPTERS_HOME directory.

If you created a custom transporter or formatter module:

  • The .jar files relating to your adapter must be in the $STREAMING_CUSTOM_ADAPTERS_HOME/libj folder
  • The new Java class must be added to the $STREAMING_CUSTOM_ADAPTERS_HOME/config/custommodulesdefine.xml file
  • The schema definitions for any unique parameters must be added to the $STREAMING_CUSTOM_ADAPTERS_HOME/config/parametersdefine.xsd file

In general:

  • The adapter_config.xml file for the customer adapter must be in the $STREAMING_CUSTOM_ADAPTERS_HOME/instances folder
    • If this directory does not already exist, create it and update the path to the file in the <custom-adapter-name>.cnxml file.
  • The <custom-adapter-name>.cnxml file must be in $STREAMING_CUSTOM_ADAPTERS_HOME/cnxml folder

 

 

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.