Files
spring-integration-samples/basic/helloworld
Artem Bilan 1aa24b6577 Upgrade dependencies and various fixes
* Remove usage of removed `org.springframework.util.SocketUtils`
in favor of OS-selected port
* Migrate mail tests to Greenmail instead of already obsolete (and soon to be removed)
`org.springframework.integration.test.mail.TestMailServer`
2022-03-24 12:02:16 -04:00
..
2019-03-22 14:52:00 -04:00
2022-03-24 12:02:16 -04:00
2019-03-22 15:59:21 -04:00

Hello World Sample

This is an obvious place to get started. This sample project contains 2 basic sample applications:

  • Hello World
  • Poller Application

Hello World

The Hello World application demonstrates a simple message flow represented by the diagram below:

Message -> Channel -> ServiceActivator -> QueueChannel 

To run the sample simply execute HelloWorldApp in package org.springframework.integration.samples.helloworld. You can also execute that class using the Gradle:

$ gradlew :helloworld:runHelloWorldApp

You should see the following output:

INFO : org.springframework.integration.samples.helloworld.HelloWorldApp - ==> HelloWorldDemo: Hello World

Poller Application

This simple application will print out the current system time twice every 20 seconds.

More specifically, an Inbound Channel Adapter polls for the current system time 2 times every 20 seconds (20000 milliseconds). The resulting message contains as payload the time in milliseconds and the message is sent to a Logging Channel Adapter, which will print the time to the command prompt.

To run the sample simply execute PollerApp in package org.springframework.integration.samples.helloworld. You can also execute that class using the Gradle:

$ gradlew :helloworld:runPollerApp

You should see output like the following:

INFO : org.springframework.integration.samples.helloworld - 1328892135471
INFO : org.springframework.integration.samples.helloworld - 1328892135524