This commit is contained in:
Phillip Webb
2018-02-08 16:34:49 -08:00
parent a0f4071390
commit 5de46c3186
60 changed files with 141 additions and 123 deletions

View File

@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package sample.kafka;
import org.springframework.kafka.annotation.KafkaListener;
@@ -26,4 +27,4 @@ class Consumer {
System.out.println("Received sample message [" + message + "]");
}
}
}

View File

@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package sample.kafka;
import org.springframework.kafka.core.KafkaTemplate;
@@ -32,4 +33,4 @@ public class Producer {
System.out.println("Sent sample message [" + message + "]");
}
}
}

View File

@@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package sample.kafka;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.Bean;
@SpringBootApplication

View File

@@ -41,11 +41,7 @@ public class SampleMessage {
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("SampleMessage{");
sb.append("id=").append(this.id);
sb.append(", message='").append(this.message).append('\'');
sb.append('}');
return sb.toString();
return "SampleMessage{id=" + this.id + ", message='" + this.message + "'}";
}
}