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
private final JmsTemplate jmsTemplate; | |
public String sendMessage(String queueName, String payload) { | |
jmsTemplate.convertAndSend( queueName, payload ); | |
} |
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
private final JmsTemplate jmsTemplate; | |
private final UserRepository userRepository; | |
... | |
@Entity | |
protected class UserEntity { | |
@Id public UUID userId; | |
@NotEmpty public String username; | |
} | |
... | |
@Transactional |
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
@Component("email") | |
public class EmailStrategy implements NotificationStrategy { ... } | |
... | |
@Component("sms") | |
public class SmsStrategy implements NotificationStrategy { ... } | |
... | |
@Service | |
public class NotificationService() { | |
@Resource(name = "email") |
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
Vector3 calculateApparentWindVector(Vector3 windSpeedVector, Vector3 boatSpeedVector) { | |
// Since Face wind vector is caused by yacht movement it | |
// has the yacht velocity magnitude but opposite direction. | |
// So we will just subtract one vector from another | |
return windSpeedVector - boatSpeedVector; | |
} |