This file contains hidden or 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.thinkmicroservices.ri.spring.notification.service.impl; | |
| import com.thinkmicroservices.ri.spring.notification.i18n.I18NResourceBundle; | |
| import com.thinkmicroservices.ri.spring.notification.messaging.EmailMessageSource; | |
| import com.thinkmicroservices.ri.spring.notification.messaging.SmsMessageSource; | |
| import com.thinkmicroservices.ri.spring.notification.messaging.message.EmailMessage; | |
| import com.thinkmicroservices.ri.spring.notification.messaging.message.MmsMessage; | |
| import com.thinkmicroservices.ri.spring.notification.messaging.message.SmsMessage; | |
| import com.thinkmicroservices.ri.spring.notification.service.EmailQueueException; |
This file contains hidden or 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.thinkmicroservices.ri.spring.notification.model; | |
| import io.swagger.annotations.ApiModel; | |
| import io.swagger.annotations.ApiModelProperty; | |
| import javax.validation.constraints.NotBlank; | |
| import javax.validation.constraints.Size; | |
| import lombok.Data; | |
| import lombok.NoArgsConstructor; |
This file contains hidden or 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.thinkmicroservices.ri.spring.notification.model; | |
| import io.swagger.annotations.ApiModel; | |
| import io.swagger.annotations.ApiModelProperty; | |
| import java.util.List; | |
| import javax.validation.constraints.NotBlank; | |
| import lombok.Data; | |
| /** | |
| * |
This file contains hidden or 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
| server: | |
| port: 8080 | |
| info: | |
| app: | |
| name: Notification Service | |
| description: Provides an outbound notification service endpoint for email and sms | |
| version: 1.0.0 | |
This file contains hidden or 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: | |
| application: | |
| name: NOTIFICATION-SERVICE | |
| cloud: | |
| config: | |
| fail-fast: true | |
| retry: | |
| max-attempts: 10 | |
| initial-interval: 1500 | |
| multiplier: 1.5 |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <parent> | |
| <groupId>org.springframework.boot</groupId> | |
| <artifactId>spring-boot-starter-parent</artifactId> | |
| <version>2.1.8.RELEASE</version> | |
| <relativePath/> <!-- lookup parent from repository --> | |
| </parent> |
This file contains hidden or 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
| ## docker-compose -f ./dc-06-outbound-sms.yml up -d | |
| version: "3.7" | |
| services: | |
| ############################################################## | |
| # INFRASTRUCTURE SERVICES | |
| ################ |
This file contains hidden or 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.thinkmicroservices.ri.spring.sms.outbound.messaging; | |
| import com.thinkmicroservices.ri.spring.sms.outbound.model.MmsRequest; | |
| import com.thinkmicroservices.ri.spring.sms.outbound.model.SmsRequest; | |
| import com.thinkmicroservices.ri.spring.sms.outbound.service.OutboundSmsException; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.cloud.stream.annotation.EnableBinding; | |
| import org.springframework.cloud.stream.annotation.StreamListener; | |
| import org.springframework.cloud.stream.messaging.Sink; | |
| import com.thinkmicroservices.ri.spring.sms.outbound.service.OutboundSmsService; |
This file contains hidden or 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.thinkmicroservices.ri.spring.sms.outbound.controller; | |
| import com.thinkmicroservices.ri.spring.sms.outbound.model.MmsRequest; | |
| import com.thinkmicroservices.ri.spring.sms.outbound.model.SmsRequest; | |
| import com.thinkmicroservices.ri.spring.sms.outbound.service.OutboundSmsException; | |
| import io.swagger.annotations.ApiOperation; | |
| import io.swagger.annotations.ApiResponse; | |
| import io.swagger.annotations.ApiResponses; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.http.HttpStatus; |
This file contains hidden or 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.thinkmicroservices.ri.spring.sms.outbound.service.twilio; | |
| import com.thinkmicroservices.ri.spring.sms.outbound.i18n.I18NResourceBundle; | |
| import com.thinkmicroservices.ri.spring.sms.outbound.service.OutboundSmsException; | |
| import com.twilio.Twilio; | |
| import com.twilio.rest.api.v2010.account.Message; | |
| import com.twilio.type.PhoneNumber; | |
| import java.net.URI; | |
| import java.util.List; |