infosphere-splibm-streams

How can I change the properties of an Export stream at runtime?


The Dynamic application composition topic says that

Properties can also be added, updated, or removed at runtime, and so can subscriptions. The compile-time properties and subscriptions just serve as initial settings.

but it doesn't say how to do that. So, how do you do that?


Solution

  • In the operator that exports the stream, call

    setOutputPortExportProperties({property1_name=value, property2_name=value, ...},
      portNumber);
    

    In the operator that imports the stream, call

    setInputPortImportSubscription(subscription_string, portNumber);
    

    SPL sample project 042_dynamic_import_export_api_at_work provides an example.