Spring boot application

Eureka Server adalah aplikasi yang menyimpan informasi tentang semua aplikasi layanan klien. Setiap layanan Mikro akan mendaftar ke server Eureka dan server Eureka tahu semua aplikasi klien yang berjalan pada setiap port dan alamat IP. Eureka Server juga dikenal sebagai Discovery Server.
Setelah mengunduh proyek dalam file kelas Aplikasi Boot Spring utama, kita perlu menambahkan penjelasan @EnableEurekaServer. Anotasi @EnableEurekaServer digunakan untuk membuat aplikasi Spring Boot Anda berfungsi sebagai Server Eureka.
tambhakan pada class main @EnableEurekaServer.
dan defedecny
<dependency>
<groupId>org.springframework.cloud</groupId>
   <artifactId>spring-cloud-starter-eureka-server</artifactId>
</dependency>
application.properties 
eureka.client.registerWithEureka = false
eureka.client.fetchRegistry = false
server.port = 8761
hit the URL http://localhost:8761/ in your web browser
dan menampilkan
saya coba belum berhasil.''

FLYWAY,
digunkan unutk migrasi skema database.
langkah
tambhakan dependecis
<!-- https://mvnrepository.com/artifact/org.flywaydb/flyway-core -->
<dependency>
    <groupId>org.flywaydb</groupId>
    <artifactId>flyway-core</artifactId>
    <version>5.2.4</version>
</dependency>

dan 
flyway.url = jdbc:mysql://localhost:3306/test
flyway.schemas = test
flyway.user = root
flyway.password = 

dan bikin folder db/migration/query.sql

Hystrix 
facllback , load balancing 
digunakan untuk memeberikan fallback apabila terjadi kegagalan saat request antar service dengan cara melakukan Load Balancing.

Unit Test Case


<dependency>
   <groupId>org.mockito</groupId>
   <artifactId>mockito-core</artifactId>
   <version>2.13.0</version>
</dependency>
<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-test</artifactId>
   <scope>test</scope>
</dependency>

1. email : bisa
<!--             //mail 1-->      <dependency>         <groupId>org.springframework.boot</groupId>         <artifactId>spring-boot-starter-mail</artifactId>      </dependency>

spring.mail.host=smtp.gmail.comspring.mail.port=587spring.mail.username=rikialdipari@gmail.comspring.mail.password=alquranhadist96
# Other propertiesspring.mail.properties.mail.smtp.auth=truespring.mail.properties.mail.smtp.connectiontimeout=5000spring.mail.properties.mail.smtp.timeout=5000spring.mail.properties.mail.smtp.writetimeout=5000
# TLS , port 587spring.mail.properties.mail.smtp.starttls.enable=true
# SSL, post 465#spring.mail.properties.mail.smtp.socketFactory.port = 465#spring.mail.properties.mail.smtp.socketFactory.class = javax.net.ssl.SSLSocketFactory


import org.springframework.beans.factory.annotation.Autowired;import org.springframework.core.io.ClassPathResource;import org.springframework.mail.javamail.JavaMailSender;import org.springframework.mail.javamail.MimeMessageHelper;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController;
import javax.mail.internet.MimeMessage;
//mail 3@RestController@RequestMapping("/api/v1/")
public class ForgetPassword {

    @Autowired    private JavaMailSender sender;
    @RequestMapping(value= "forgetpass") // uutk aktifkan port 587 login email dan uri https://myaccount.google.com/lesssecureapps?pli=1    private void sendEmail() throws Exception{
        MimeMessage message = sender.createMimeMessage();
// Enable the multipart flag!        MimeMessageHelper helper = new MimeMessageHelper(message,true);
        helper.setTo("rikialdipari96@gmail.com");        helper.setText("How are you?");        helper.setSubject("Hi2");
 ClassPathResource file = new ClassPathResource("a.png"); helper.addAttachment("as.png", file); //bisa
        sender.send(message);    }
Share on Google Plus

About riki aldi pari

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 komentar:

Posting Komentar