Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/interlok 4149 jdbc retrystore #1254

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Open
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public abstract class HttpRequestServiceImpl extends ServiceImp {
* Set the read timeout.
* <p>
* Note that any read timeout will be overridden by the timeout value passed in via the
* {{@link #request(AdaptrisMessage, long)} method; if it is not the same as
* {{@link com.adaptris.core.RequestReplyProducerImp#request(AdaptrisMessage, long)} method; if it is not the same as
* {@value com.adaptris.core.http.HttpConstants#DEFAULT_SOCKET_TIMEOUT}
* </p>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.apache.commons.lang3.BooleanUtils;
import com.adaptris.annotation.ComponentProfile;
import com.adaptris.annotation.DisplayOrder;
import com.adaptris.core.AdaptrisConnection;
import com.adaptris.core.AdaptrisMessage;
import com.adaptris.core.AdaptrisMessageFactory;
import com.adaptris.core.CoreException;
Expand Down Expand Up @@ -231,33 +230,4 @@ public FilesystemRetryStore withBaseUrl(String s) {
return this;
}

@Override
public void acknowledge(String acknowledgeId) throws InterlokException {
// null implementation
}

@Override
public void deleteAcknowledged() throws InterlokException {
// null implementation
}

@Override
public List<AdaptrisMessage> obtainExpiredMessages() throws InterlokException {
return null; // null implementation
}

@Override
public List<AdaptrisMessage> obtainMessagesToRetry() throws InterlokException {
return null; // null implementation
}

@Override
public void updateRetryCount(String messageId) throws InterlokException {
// null implementation
}

@Override
public void makeConnection(AdaptrisConnection connection) {
// null implementation
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package com.adaptris.core.http.jetty.retry;

import java.util.Collections;
import java.util.List;
import java.util.Map;

import com.adaptris.core.AdaptrisConnection;
import com.adaptris.core.AdaptrisMessage;
import com.adaptris.core.AdaptrisMessageFactory;
import com.adaptris.core.ComponentLifecycle;
Expand Down Expand Up @@ -91,69 +89,4 @@ default boolean delete(String msgId) throws InterlokException {
default void prepare() throws CoreException {
}

/**
* <p>
* Acknowledge that the message with the passed ID has now been successfully
* processed and should not be retried again. NB this method does not throw an
* Exception if the acknowledge ID does not exist in the store.
* </p>
*
* @param acknowledgeId the acknowledge ID of the message to acknowledge
* @throws InterlokException wrapping any <code>Exception</code> which occurs
*/
void acknowledge(String acknowledgeId) throws InterlokException;

/**
* Delete any messages that have been successfully Acknowledged.
*
* @throws InterlokException wrapping any <code>Exception</code> which occurs
*/
void deleteAcknowledged() throws InterlokException;

/**
* <p>
* Obtain a list of <code>AdaptrisMessage</code>s which meet the expiration
* criteria.
* In the most abstract sense, expired messages are those that have exceeded
* their max retry count but not yet been acknowledged.
* </p>
*
* @return a list of <code>AdaptrisMessage</code>s which meet the expiration
* criteria.
* @throws InterlokException wrapping any <code>Exception</code> which occurs
*/
List<AdaptrisMessage> obtainExpiredMessages() throws InterlokException;

/**
* <p>
* Obtain a list of <code>AdaptrisMessage</code>s which meet the criteria
* for retrying.
* </p>
*
* @return a list of <code>AdaptrisMessage</code>s which meet the criteria
* for retrying
* @throws InterlokException wrapping any <code>Exception</code> which occurs
*/
List<AdaptrisMessage> obtainMessagesToRetry() throws InterlokException;

/**
* <p>
* Update the number of retries which have taken place for the message with
* the passed ID. NB this method does not throw an Exception if an attempt is
* made to update the retry count for a message ID which does not exist in the
* store.
* </p>
*
* @param messageId the ID of the message to update
* @throws InterlokException wrapping any <code>Exception</code> which occurs
*/
void updateRetryCount(String messageId) throws InterlokException;

/**
* <p>
* Used for any implementations that have a connected RetryStore
* </p>
*/
void makeConnection(AdaptrisConnection connection);

}
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public final class Constants {
*/
public static final String ASYNC_AUTO_RETRY = "retryAsyncRetry";

protected static final String ACKNOWLEDGED = "T";
protected static final String NOT_ACKNOWLEDGED = "F";
public static final String ACKNOWLEDGED = "T";
public static final String NOT_ACKNOWLEDGED = "F";

private Constants() {
// no instances
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

/**
* <p>
* Represents an entry in <code>retry_store</code>, the sole table in the
* 'retry store database'.
* Represents an entry in <code>retry table</code>, the sole table in the
* 'retry database'.
* </p>
*/
class JdbcRetryStoreEntry {
public class JdbcRetryRowEntry {

private String messageId;
private String acknowledgeId;
Expand All @@ -21,83 +21,83 @@ class JdbcRetryStoreEntry {
private Date insertedOn;
private Date updatedOn;

Date getInsertedOn() {
public Date getInsertedOn() {
return insertedOn;
}

void setInsertedOn(Date d) {
public void setInsertedOn(Date d) {
this.insertedOn = d;
}

Date getUpdatedOn() {
public Date getUpdatedOn() {
return updatedOn;
}

void setUpdatedOn(Date d) {
public void setUpdatedOn(Date d) {
this.updatedOn = d;
}

String getAcknowledgeId() {
public String getAcknowledgeId() {
return acknowledgeId;
}

void setAcknowledgeId(String s) {
public void setAcknowledgeId(String s) {
this.acknowledgeId = s;
}

byte[] getEncodedMessage() {
public byte[] getEncodedMessage() {
return encodedMessage;
}

void setEncodedMessage(byte[] b) {
public void setEncodedMessage(byte[] b) {
this.encodedMessage = b;
}

String getMessageId() {
public String getMessageId() {
return messageId;
}

void setMessageId(String s) {
public void setMessageId(String s) {
this.messageId = s;
}

int getTotalRetries() {
public int getTotalRetries() {
return totalRetries;
}

void setTotalRetries(int i) {
public void setTotalRetries(int i) {
this.totalRetries = i;
}

int getRetriesToDate() {
public int getRetriesToDate() {
return retriesToDate;
}

void setRetriesToDate(int i) {
public void setRetriesToDate(int i) {
this.retriesToDate = i;
}

int getRetryInterval() {
public int getRetryInterval() {
return retryInterval;
}

void setRetryInterval(int i) {
public void setRetryInterval(int i) {
this.retryInterval = i;
}

String getMarshalledService() {
public String getMarshalledService() {
return marshalledService;
}

void setMarshalledService(String s) {
public void setMarshalledService(String s) {
this.marshalledService = s;
}

boolean getAcknowledged() {
public boolean getAcknowledged() {
return acknowledged;
}

void setAcknowledged(boolean b) {
public void setAcknowledged(boolean b) {
this.acknowledged = b;
}
}
Loading