|
| 1 | +/* |
| 2 | + * Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with |
| 5 | + * the License. A copy of the License is located at |
| 6 | + * |
| 7 | + * http://aws.amazon.com/apache2.0 |
| 8 | + * |
| 9 | + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR |
| 10 | + * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions |
| 11 | + * and limitations under the License. |
| 12 | + */ |
| 13 | +package com.amazonaws.services.lambda.runtime.events; |
| 14 | + |
| 15 | +import lombok.AllArgsConstructor; |
| 16 | +import lombok.Builder; |
| 17 | +import lombok.Data; |
| 18 | +import lombok.EqualsAndHashCode; |
| 19 | +import lombok.NoArgsConstructor; |
| 20 | +import java.util.List; |
| 21 | + |
| 22 | +/** |
| 23 | +* Represents an Active MQ event sent to Lambda |
| 24 | +* <a href="https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html">Onboarding Amazon MQ as event source to Lambda</a> |
| 25 | +*/ |
| 26 | +@Data |
| 27 | +@NoArgsConstructor |
| 28 | +@AllArgsConstructor |
| 29 | +@Builder(setterPrefix = "with") |
| 30 | +public class ActiveMQEvent { |
| 31 | + private String eventSource; |
| 32 | + private String eventSourceArn; |
| 33 | + private List<ActiveMQMessage> messages; |
| 34 | + |
| 35 | + @Data |
| 36 | + @NoArgsConstructor |
| 37 | + @AllArgsConstructor |
| 38 | + @Builder(setterPrefix = "with") |
| 39 | + public static class ActiveMQMessage { |
| 40 | + private String messageID; |
| 41 | + private String messageType; |
| 42 | + private long timestamp; |
| 43 | + private int deliveryMode; |
| 44 | + private String correlationID; |
| 45 | + private String replyTo; |
| 46 | + private Destination destination; |
| 47 | + private boolean redelivered; |
| 48 | + private String type; |
| 49 | + private long expiration; |
| 50 | + private int priority; |
| 51 | + /** Message data sent to Active MQ broker encooded in Base 64 **/ |
| 52 | + private String data; |
| 53 | + private long brokerInTime; |
| 54 | + private long brokerOutTime; |
| 55 | + } |
| 56 | + |
| 57 | + @Data |
| 58 | + @NoArgsConstructor |
| 59 | + @AllArgsConstructor |
| 60 | + @Builder(setterPrefix = "with") |
| 61 | + public static class Destination { |
| 62 | + /** Queue Name **/ |
| 63 | + private String physicalName; |
| 64 | + } |
| 65 | +} |
0 commit comments