One of the very new cool features in Neuron ESB is the ability for users to create their own custom pipeline steps, and have those steps show up in the right hand Pipeline Step pane within the Neuron ESB Pipeline Designer. This provides a great way for developers to create reusable code assets for other developers to use with any project.
Previously, if a developer wanted to create new capabilities using Visual Studio and reuse those capabilities within Neuron, it required creating a library assembly and referencing that assembly within a Code Pipeline Step. If there were N number of Code Pipeline Steps, the assembly would have to be re referenced in each one. Obviously, if the assembly changed, all Code Pipeline Steps would have to be changed as well.
Custom Pipeline Steps allow developers to create reusable capability that doesn’t require re referencing custom assemblies within Code Pipeline Steps. Furthermore, new capabilities can be parameterized and driven by publicly exposed properties using the Neuron property grid (lower right hand corner of the designer), controlling exactly how developers interact with the new capability both at design time and runtime.
Using Custom Pipeline Steps is a three step process, Create, Deploy and Register:
Creating a Custom Pipeline Step requires creating a Visual Studio .NET C# Class project. This will have at least 1 class that implements the Neuron.Esb.Pipelines.CustomPipelineStep base class. This base class has one method to override, OnExecute().
This class can optionally contain public properties that are exposed using the Microsoft Property Grid within the Neuron ESB Pipeline Designer. The class attributes, DisplayName and Description are used to control what name and description are displayed within the Neuron ESB Pipeline Designer.
Additionally, a graphic (PNG 16x16) can be included in the project. This graphic is used as the icon that represents the Custom Pipeline Step within the Neuron ESB Pipeline Designer window. The file name of the graphic must exactly follow that of the namespace and class name of the Custom Pipeline Step class.
For example, if the namespace of the Custom Pipeline Step is “Neuron.Pipelines.CustomSamples” and the class name is “MyCustomPipelineStep”, then the image file included in the Visual Studio .NET C# Class library must be named, “Neuron.Pipelines.CustomSamples.MyCustomPipelineStep.png”
Once the Custom Pipeline Step is compiled, it is ready to deploy.
A sample of a Custom Pipeline Step can be found in the Samples\Features\Pipelines\Neuron.Pipelines.CustomSamples directory located at the root of the Neuron ESB installation directory
NOTE: Custom Pipeline Steps can optionally be signed with a strong named key (snk) if they need to be copied to the Global Assembly Cache (GAC).
Deploying a Custom Pipeline Step involves copying the previously created assembly that contains it, to the Pipelines directory located at the root of the Neuron ESB installation directory.
If using the Neuron ESB Client API on a remote machine that is NOT running the Neuron ESB Service (hosted by a custom application), than that assembly should either be deployed to the local GAC, or in the Bin directory of the hosting application.
Once a Custom Pipeline Step is deployed, it must be registered in the neuronpipelines.config file within the Pipelines directory located at the root of the Neuron ESB installation directory:
<neuron.pipelines>
<stepTypes>
</stepTypes>
</neuron.pipelines>
Registration requires inserting the assembly reference by using the “Add” element as follows:
<neuron.pipelines>
<stepTypes>
/i>add name="MyCustomPipelineStep" value="Neuron.Pipelines.CustomSamples, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ecaf0c45d7be0e34"/>
</stepTypes>
</neuron.pipelines>
Once the registration is complete, the Neuron ESB Service must be restarted if using Service Endpoints or Adapter Endpoints that will be using the Custom Pipeline Step.
If using the Neuron ESB Client API on a remote machine that is NOT running the Neuron ESB Service (hosted by a custom application), than the new Pipeline Step’s registration information needs to be added within the App.Config file of the hosting application as follows:
<configuration>
<configSections>
<section name="neuron.pipelines" type="Neuron.Configuration.PipelinesConfigurationSection, Neuron"/>
</configSections>
<neuron.pipelines>
<stepTypes>
<add name="MyCustomPipelineStep" value="Neuron.Pipelines.CustomSamples, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ecaf0c45d7be0e34"/>
</stepTypes>
</neuron.pipelines>
</configuration>
Tags:
Neuron ESB Product Support Forums and Communities
© 2024 Created by Neuron Admin. Powered by