Skip to content

rnhc1000/notifications-sns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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