Http Connecter setting response and status null / Register plugin in spring boot application yml

Hi

I have started a test bpm project looking at the camunda quick start rest service.

Have a spring boot application.

Got the dependency sorted out using sample POM.

As per the documentation with the sample application (readme) , process engine plugins provided by Spin and Connect are registered with the engine in camunda.cfg.xml

<property name="processEnginePlugins">
      <list>
        <bean class="org.camunda.connect.plugin.impl.ConnectProcessEnginePlugin" />
        <bean class="org.camunda.spin.plugin.impl.SpinProcessEnginePlugin" />
      </list>
    </property>

Since mine is a spring boot application have an applicaiton.yml

How do I register the process engine plugin for spring boot application?

The application is working but getting null in the response in the variable list.

@AmeyaShetti you just need to declare a Spring bean implementing ProcessEnginePlugin and it will be automatically registered in the engine.

@aravindhrs I have been through that post some sample code showing the initialization of ProcessEnginePlugin will help

@AmeyaShetti did you added the required dependency for connector and spin plugins?

@AmeyaShetti can you provide the stacktrace and your pom.xml file?

@aravindhrs yes that is taken care in the pom.

I was initially was getting the error related to the connector task that it needs to have class defined in xml etc. That was fixed adding the dependency. There is no error, but I am trying to log the ouput for the connector using the logger. Getting the response and status code null.

logging variable collection

response => Untyped ‘null’ value
statusCode => Untyped ‘null’ value

Refer these posts, may be solve the problem.

@aravindhrs what you are replying I have already googled and tried, it would help if you give me a solution in form of sample code for initializing the plugins bean what you said in the start. The solution cannot be simply giving me all the google searches. :slight_smile: .

@AmeyaShetti, without providing the stacktrace and pom.xml file, it won’t be easier to understand the problem and to analyze it. Details for analyzing the problem should be sufficient.

@aravindhrs I have added the code on my GIT . Please find the pom files here. Can also run the application simple, few file application.

@aravindhrs did you check code?

Hi @AmeyaShetti,

you have to pride a value for the output parameter. As your value field is empty, the variable is null.

The value could be a expression to resolve the response body: https://docs.camunda.org/manual/7.12/reference/connect/http-connector/#using-the-generic-api-1, like ${response}.

Hope this helps,

Ingo

@Ingo_Richtsmeier Thank you, that worked like a charm.

So for spring boot, you don’t need to register processor engine plugin.

updating git with fixed application

@Ingo_Richtsmeier, how to work with proxy in http-connector?

Hi @AmeyaShetti,

sorry, I have no experience here. The Connectors are kind of black box for this.

Maybe you have chance by extending them: https://docs.camunda.org/manual/7.12/reference/connect/extending-connect/

Or with internal knowledge of the implementation. They are based on Apache HTTP Client.

The third (and my preferred way) is to replace the usage of connectors with an external task worker implemented and controlled by yourself.

Hope this helps, Ingo