Skip to content

Latest commit

 

History

History
77 lines (60 loc) · 1.97 KB

README.md

File metadata and controls

77 lines (60 loc) · 1.97 KB

Take-home SNS Microservices Challenge

This is how we faced the challenge of creating a notification sns services.

Table of contents

Overview

The design is structured as shown:

  • src|
    • main
    • java|
      • com/xxx/challenge/notificationSnsService|
        • config
        • dto
        • consumer
        • service
      • test

Screenshot

Links

Built with

My Skills

How I did it

package com.gila.challenge.notificationSnsService.service;

import com.amazonaws.services.sns.AmazonSNS;
import com.amazonaws.services.sns.model.PublishRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MessageSnsService {
  @Autowired
  private AmazonSNS amazonSNS;

  public void notify(String phone, String message, String name) {

    PublishRequest publishRequest = new PublishRequest()
            .withMessage(message)
            .withPhoneNumber(phone)
            .withSubject(name);

    amazonSNS.publish(publishRequest);
  }

}

Continued development

  • maybe

Useful resources

Author

Acknowledgments