Skip to content

Commit

Permalink
Remove the native usage section in each supported sample and add a ne…
Browse files Browse the repository at this point in the history
…w sample to introduce the Spring Native support separately.
  • Loading branch information
moarychan committed Apr 24, 2022
1 parent 2745c3d commit d6e3a22
Show file tree
Hide file tree
Showing 53 changed files with 603 additions and 789 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ It supports both Bash environment and [PowerShell](https://docs.microsoft.com/en
Please refer to [README.md](servicebus/spring-cloud-azure-starter-integration-servicebus/single-namespace/README.md) under each sample for detailed information.

### Run Samples Based On Spring Native
The parent project POM file has been configured with support for `Spring Native` to build a Spring Boot native application by default, which can be built based on [Buildpacks](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#getting-started-buildpacks) and [Native Build Tools](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#getting-started-native-build-tools), please follow the readme doc in each sample to build a specific native application.
The parent project POM file has been configured with the `Spring Native` support to build a Spring Boot native application by default, which can be built based on [Buildpacks](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#getting-started-buildpacks) and [Native Build Tools](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#getting-started-native-build-tools), please follow the readme doc in each sample to build a specific native application.

[spring-cloud-azure-starter-keyvault-secrets:4.0.0]: https://search.maven.org/artifact/com.azure.spring/spring-cloud-azure-starter-keyvault-secrets/4.0.0/jar
[spring-cloud-azure-stream-binder-eventhubs:4.0.0]: https://search.maven.org/artifact/com.azure.spring/spring-cloud-azure-stream-binder-eventhubs/4.0.0/jar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ terraform -chdir=./terraform apply -auto-approve

```

#### Run with Powershell, Command Prompt or Native Tools Command Prompt
#### Run with Powershell

```shell
# In the root directory of the sample
Expand Down Expand Up @@ -117,12 +117,6 @@ source ./terraform/setup_env.sh
terraform\setup_env.ps1
```

#### Run with Command Prompt or Native Tools Command Prompt

```shell
terraform\setup_env.bat
```

If you want to run the sample in debug mode, you can save the output value.

```shell
Expand All @@ -147,52 +141,6 @@ You can debug your sample by adding the saved output values to the tool's enviro

* If your tool is `ECLIPSE`, please refer to [Debugging the Eclipse IDE for Java Developers](https://www.eclipse.org/community/eclipse_newsletter/2017/june/article1.php) and [Eclipse Environment Variable Setup](https://examples.javacodegeeks.com/desktop-java/ide/eclipse/eclipse-environment-variable-setup-example/).

### Run the sample based on Spring Native

There are two main ways to build a Spring Boot native application.

#### Run with Buildpacks

- System Requirements

Docker should be installed, see [System Requirements](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#getting-started-buildpacks-system-requirements) for more details.

- Build the native application

Run `mvn -Pbuildpack package spring-boot:build-image`, see [Build the native application](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#_build_the_native_application) for more details.

```shell
mvn -Pbuildpack package spring-boot:build-image
```

- Run the native application

Run `docker run --rm -p 8080:8080 appconfiguration-sample:1.0.0`, see [Run the native application](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#_run_the_native_application) for more details.
```shell
docker run --rm -p 8080:8080 appconfiguration-sample:1.0.0
```

#### Run with Native Build Tools

- System Requirements

GraalVM `native-image` compiler should be installed, see [System Requirements](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#getting-started-native-image-system-requirements) for more details. If using the Windows platform, you need to install `Visual Studio Build Tools`.

- Build the native application

Run `mvn -Pnative -DskipTests package`, see [Build the native application](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#_build_the_native_application_2) for more details.

```shell
mvn -Pnative -DskipTests package
```

- Run the native application

Run `target\appconfiguration-sample`, see [Run the native application](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#_run_the_native_application_2) for more details.
```shell
target\appconfiguration-sample
```

## Verify This Sample
View the below results in the console.

Expand All @@ -213,7 +161,7 @@ To destroy the resources you created.
terraform -chdir=./terraform destroy -auto-approve
```

#### Run with Powershell, Command Prompt or Native Tools Command Prompt
#### Run with Powershell

```shell
terraform -chdir=terraform destroy -auto-approve
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
<name>Read and Write Data with Azure Cosmos DB Using CosmosClient</name>
<description>Sample project for Spring Cloud Azure Starter Cosmos</description>

<properties>
<imageName>spring-cloud-azure-cosmos-sample</imageName>
</properties>

<dependencies>
<dependency>
<groupId>com.azure.spring</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ terraform -chdir=./terraform apply -auto-approve

```

#### Run with Powershell, Command Prompt or Native Tools Command Prompt
#### Run with Powershell

```shell
# In the root directory of the sample
Expand Down Expand Up @@ -140,12 +140,6 @@ source ./terraform/setup_env.sh
. terraform\setup_env.ps1
```

#### Run with Command Prompt or Native Tools Command Prompt

```shell
terraform\setup_env.bat
```

If you want to run the sample in debug mode, you can save the output value.

```shell
Expand Down Expand Up @@ -174,52 +168,6 @@ You can debug your sample by adding the saved output values to the tool's enviro

* If your tool is `ECLIPSE`, please refer to [Debugging the Eclipse IDE for Java Developers](https://www.eclipse.org/community/eclipse_newsletter/2017/june/article1.php) and [Eclipse Environment Variable Setup](https://examples.javacodegeeks.com/desktop-java/ide/eclipse/eclipse-environment-variable-setup-example/).

### Run the sample based on Spring Native

There are two main ways to build a Spring Boot native application.

#### Run with Buildpacks

- System Requirements

Docker should be installed, see [System Requirements](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#getting-started-buildpacks-system-requirements) for more details.

- Build the native application

Run `mvn -Pbuildpack package spring-boot:build-image`, see [Build the native application](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#_build_the_native_application) for more details.

```shell
mvn -Pbuildpack package spring-boot:build-image
```

- Run the native application

Run `docker run --rm -p 8080:8080 eventhubs-client:1.0.0`, see [Run the native application](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#_run_the_native_application) for more details.
```shell
docker run --rm -p 8080:8080 eventhubs-client:1.0.0
```

#### Run with Native Build Tools

- System Requirements

GraalVM `native-image` compiler should be installed, see [System Requirements](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#getting-started-native-image-system-requirements) for more details. If using the Windows platform, you need to install `Visual Studio Build Tools`.

- Build the native application

Run `mvn -Pnative -DskipTests package`, see [Build the native application](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#_build_the_native_application_2) for more details.

```shell
mvn -Pnative -DskipTests package
```

- Run the native application

Run `target\eventhubs-client`, see [Run the native application](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#_run_the_native_application_2) for more details.
```shell
target\eventhubs-client
```

## Verify This Sample

1. Verify in your app’s logs that similar messages were posted:
Expand Down Expand Up @@ -248,7 +196,7 @@ To destroy the resources you created.
terraform -chdir=./terraform destroy -auto-approve
```

#### Run with Powershell, Command Prompt or Native Tools Command Prompt
#### Run with Powershell

```shell
terraform -chdir=terraform destroy -auto-approve
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@
<version>1.0.0</version>
<packaging>jar</packaging>

<name>Communicate to a Single Event Hubs Namespace via Aazure SDK for EventHubs</name>

<properties>
<imageName>eventhubs-client</imageName>
</properties>
<name>Communicate to a Single Event Hubs Namespace via Azure SDK for EventHubs</name>

<dependencies>
<dependency>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ terraform -chdir=./terraform apply -auto-approve

```

#### Run with Powershell, Command Prompt or Native Tools Command Prompt
#### Run with Powershell

```shell
# In the root directory of the sample
Expand Down Expand Up @@ -136,12 +136,6 @@ source ./terraform/setup_env.sh
terraform\setup_env.ps1
```

#### Run with Command Prompt or Native Tools Command Prompt

```shell
terraform\setup_env.bat
```

If you want to run the sample in debug mode, you can save the output value.

```shell
Expand All @@ -168,53 +162,6 @@ You can debug your sample by adding the saved output values to the tool's enviro

* If your tool is `ECLIPSE`, please refer to [Debugging the Eclipse IDE for Java Developers](https://www.eclipse.org/community/eclipse_newsletter/2017/june/article1.php) and [Eclipse Environment Variable Setup](https://examples.javacodegeeks.com/desktop-java/ide/eclipse/eclipse-environment-variable-setup-example/).

### Run the sample based on Spring Native

There are two main ways to build a Spring Boot native application.

#### Run with Buildpacks

- System Requirements

Docker should be installed, see [System Requirements](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#getting-started-buildpacks-system-requirements) for more details.

- Build the native application

Run `mvn -Pbuildpack package spring-boot:build-image`, see [Build the native application](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#_build_the_native_application) for more details.

```shell
mvn -Pbuildpack package spring-boot:build-image
```

- Run the native application

Run `docker run --rm -p 8080:8080 eventhubs-integration:1.0.0`, see [Run the native application](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#_run_the_native_application) for more details.
```shell
docker run --rm -p 8080:8080 eventhubs-integration:1.0.0
```

#### Run with Native Build Tools

- System Requirements

GraalVM `native-image` compiler should be installed, see [System Requirements](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#getting-started-native-image-system-requirements) for more details. If using the Windows platform, you need to install `Visual Studio Build Tools`.

- Build the native application

Run `mvn -Pnative -DskipTests package`, see [Build the native application](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#_build_the_native_application_2) for more details.

```shell
mvn -Pnative -DskipTests package
```

- Run the native application

Run `target\eventhubs-integration`, see [Run the native application](https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#_run_the_native_application_2) for more details.
```shell
target\eventhubs-integration
```


## Verify This Sample

1. Send a POST request
Expand Down Expand Up @@ -244,7 +191,7 @@ To destroy the resources you created.
terraform -chdir=./terraform destroy -auto-approve
```

#### Run with Powershell, Command Prompt or Native Tools Command Prompt
#### Run with Powershell

```shell
terraform -chdir=terraform destroy -auto-approve
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@

<name>Communicate to Event Hubs via Spring Integration</name>

<properties>
<imageName>eventhubs-integration</imageName>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down

This file was deleted.

Loading

0 comments on commit d6e3a22

Please sign in to comment.