This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.kafka; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.kafka.annotation.KafkaListener; | |
import org.springframework.kafka.support.KafkaHeaders; | |
import org.springframework.messaging.handler.annotation.Header; | |
import org.springframework.stereotype.Service; | |
@Service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.kafka; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.kafka.core.KafkaTemplate; | |
import org.springframework.kafka.support.SendResult; | |
import org.springframework.stereotype.Service; | |
import org.springframework.util.concurrent.ListenableFuture; | |
import org.springframework.util.concurrent.ListenableFutureCallback; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.kafka; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.CommandLineRunner; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.WebApplicationType; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.kafka.config.KafkaListenerEndpointRegistry; | |
import org.springframework.kafka.listener.MessageListenerContainer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spring: | |
kafka: | |
bootstrap-servers: <BOOTSTRAP_SERVER_URL> | |
properties: | |
security: | |
protocol: SASL_SSL | |
sasl: | |
jaas: | |
config: org.apache.kafka.common.security.plain.PlainLoginModule required username='<CLUSTER_API_KEY>' password='<CLUSTER_API_SECRET>'; | |
mechanism: PLAIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.demo.service; | |
import com.example.demo.model.Contact; | |
import org.junit.jupiter.api.AfterAll; | |
import org.junit.jupiter.api.Assertions; | |
import org.junit.jupiter.api.BeforeAll; | |
import org.junit.jupiter.api.Test; | |
import org.junit.jupiter.api.TestInstance; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.test.context.SpringBootTest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.demo; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.boot.builder.SpringApplicationBuilder; | |
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; | |
@SpringBootApplication | |
public class DemoApplication extends SpringBootServletInitializer { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Java Gradle CircleCI 2.0 configuration file | |
# | |
# Check https://circleci.com/docs/2.0/language-java/ for more details | |
# | |
version: 2 | |
jobs: | |
build: | |
docker: | |
# specify the version you desire here | |
- image: circleci/openjdk:8-jdk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.demo; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.web.bind.annotation.GetMapping; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
import javax.mail.MessagingException; | |
import java.io.UnsupportedEncodingException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.demo; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.mail.javamail.JavaMailSender; | |
import org.springframework.mail.javamail.MimeMessageHelper; | |
import org.springframework.scheduling.annotation.Async; | |
import org.springframework.stereotype.Service; | |
import javax.mail.MessagingException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%> | |
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> | |
<h1>Update Contact</h1> | |
<form:form method="post" action="/update-contact/${id}"> | |
<table> | |
<tr> | |
<td>Name: </td> | |
<td><form:input path="name"/></td> | |
</tr> |
NewerOlder