Skip to content

Commit

Permalink
Move acknowledgement class and add exception caused by acknowledgement
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskleeh committed Feb 4, 2019
1 parent 2a887d5 commit eaa1c7f
Showing 2 changed files with 46 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -14,7 +14,9 @@
* limitations under the License.
*/

package io.micronaut.messaging.acknowledgement;
package io.micronaut.messaging;

import io.micronaut.messaging.exceptions.MessageAcknowledgementException;

/**
* A contract that allows for responding to messages.
@@ -27,10 +29,10 @@ public interface Acknowledgement {
/**
* Acknowledges the message.
*/
void ack();
void ack() throws MessageAcknowledgementException;

/**
* Rejects the message.
*/
void nack();
void nack() throws MessageAcknowledgementException;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright 2017-2018 original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.micronaut.messaging.exceptions;

/**
* An exception thrown when a message is being acknowledged or rejected.
*
* @author James Kleeh
* @since 1.1.0
*/
public class MessageAcknowledgementException extends MessageListenerException {

/**
* @param message The message
*/
public MessageAcknowledgementException(String message) {
super(message);
}

/**
* @param message The message
* @param cause The throwable
*/
public MessageAcknowledgementException(String message, Throwable cause) {
super(message, cause);
}
}

0 comments on commit eaa1c7f

Please sign in to comment.