Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions basic/barrier/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-rabbitmq</artifactId>
<version>4.1.0-SNAPSHOT</version>
<artifactId>spring-boot-starter-amqp</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
58 changes: 58 additions & 0 deletions basic/grpc-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
gRPC Client Sample
==================

This example demonstrates the use of Spring Integration's **gRPC Outbound Gateway** for client-side communication.

It uses Java configuration and the Spring Integration DSL to configure the gRPC client adapters.

The sample demonstrates two gRPC communication patterns:

1. **Single Response** - Simple request/reply pattern where the client sends a request and receives a single response
2. **Streaming Response** - The client sends a request and receives a stream of responses

## Prerequisites

This sample requires a gRPC server to be running. You can use any gRPC server that implements the `Simple` service defined in `hello.proto`, or run the test which uses an in-process gRPC server.

## Running the sample

### Command Line Using Gradle

To run the sample using Gradle, execute:

$ gradlew :grpc-client:bootRun

This will start the Spring Boot application using the [Spring Boot Gradle Plugin](https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/html/).

## Configuration

The application expects a gRPC server to be available. By default, it connects to `localhost:9090`. You can configure the server address in `application.properties`:

```properties
spring.grpc.client.channels.spring-integration.address=static://localhost:9090
```

## Output

The application demonstrates two patterns:

### Single Response Pattern

The client sends a `HelloRequest` with name "Jack" and receives a single `HelloReply`:

Single response reply: message: Hello Jack

### Streaming Response Pattern

The client sends a `HelloRequest` with name "Jane" and receives multiple `HelloReply` messages:

Stream received reply: Hello Jane
Stream received reply: Hello Again

## Running the Tests

The test uses an in-process gRPC server and does not require an external server:

$ gradlew :grpc-client:test

The test validates both single-response and streaming-response patterns.
Loading
Loading