Skip to content

CAMEL-15088: camel-dapr - add Dapr component, invokeService operation #17818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

anirudh-04
Copy link
Contributor

Description

Added the Dapr Component. I have included invoke service producer for now, there are a few other operations as well which we can integrate, would be working on those next.

Target

  • I checked that the commit is targeting the correct branch (Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • I checked that each commit in the pull request has a meaningful subject line and body.
  • I have run mvn clean install -DskipTests locally from root folder and I have committed all auto-generated changes.

Copy link
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟

🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run

  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot.

  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.

  • Build and test logs are available in the Summary page. Only Apache Camel committers have access to the summary.

  • ⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@anirudh-04 anirudh-04 marked this pull request as ready for review April 21, 2025 19:01
Copy link
Contributor

@davsclaus davsclaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also I suggest to add some more content in the docs file from the start so its not forgotten and we have poor docs for this when you add more stuff.

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<firstVersion>4.11.0</firstVersion>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be 4.12

<description>Camel Dapr component</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these 2 are not needed

<dependency>
<groupId>io.dapr</groupId>
<artifactId>dapr-sdk</artifactId>
<version>1.13.1</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the version should be in parent/pom

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
<version>2.21.1</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the versions from the test dependencies

/**
* Dapr component which interfaces with Dapr Building Blocks.
*/
@UriEndpoint(firstVersion = "4.11.0", scheme = "dapr", title = "Dapr", syntax = "dapr:operation",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4.12


@Override
public void process(Exchange exchange) throws Exception {
LOG.info("Processing operation: {}", configurationOptionsProxy.getOperation());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug logging level

@@ -338,6 +338,7 @@
<module>camel-jooq</module>
<!-- observability-services requires the availability of other components -->
<module>camel-observability-services</module>
<module>camel-dapr</module>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this up so its in the sorted list with the other components that start with a d

@davsclaus
Copy link
Contributor

Great work please keep it up

Copy link
Contributor

@oscerd oscerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good so far, do you plan to add other operations?

}

private void setResponse(Exchange exchange, DaprOperationResponse response) {
exchange.getMessage().setBody(response.getBody(), String.class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I would add some guard on the response, to check if it's not null the body.

@anirudh-04
Copy link
Contributor Author

Checked in the above requested changes. @oscerd yes I do plan to work on other operations as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants