Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
peterj99a committed Sep 27, 2017
1 parent 9a15108 commit 4a65910
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2854,7 +2854,7 @@ else if ( ( v instanceof String ) && isBlank( ( String ) v ) ) {

// add to and index in collection of the application
if ( !is_application) {
updateIndexForEniity(eType, entity, timestamp);
updateIndexForEntity(eType, entity, timestamp);
}

//write to our types map
Expand All @@ -2864,7 +2864,7 @@ else if ( ( v instanceof String ) && isBlank( ( String ) v ) ) {
return entity;
}

private <A extends Entity> void updateIndexForEniity(String eType, A entity, long timestamp) throws Exception {
private <A extends Entity> void updateIndexForEntity(String eType, A entity, long timestamp) throws Exception {
String collectionName = Schema.defaultCollectionName( eType );
CpRelationManager cpr = ( CpRelationManager ) getRelationManager( getApplication() );
cpr.addToCollection( collectionName, entity );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@


import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.UUID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ public class SNSQueueManagerImpl implements LegacyQueueManager {
private static final int MIN_VISIBILITY_TIMEOUT = 1; //seconds
private static final String DEAD_LETTER_QUEUE_SUFFIX = "_dead";

private static final String FAILED_TO_SEND_MESSAGE = "FAILED INDEX REQUEST: Failed to send message to SNS Queue, sending asynchronously. Message:[{}] URL:[{}] Error:[{}]";

static {

/**
Expand Down Expand Up @@ -573,7 +575,7 @@ private <T extends Serializable> void sendMessageToAllRegionsSync(final T body)
}
} catch (Exception e) {
if (logger.isErrorEnabled()) {
logger.error("Failed to send this message {} to SNS queue at {}", stringBody, topicArn);
logger.error(FAILED_TO_SEND_MESSAGE, stringBody, topicArn, e);
}
sendMessageToAllRegionsAsync(body);
}
Expand All @@ -591,7 +593,7 @@ private <T extends Serializable> void sendMessageToAllRegionsAsync(final T body

final String stringBody = toString( body );

String topicArn = getWriteTopicArn();
final String topicArn = getWriteTopicArn();

if ( logger.isTraceEnabled() ) {
logger.trace( "Publishing Message...{} to arn: {}", stringBody, topicArn );
Expand All @@ -603,6 +605,7 @@ private <T extends Serializable> void sendMessageToAllRegionsAsync(final T body
@Override
public void onError( Exception e ) {
logger.error( "Error publishing message... {}", e );
logger.error(FAILED_TO_SEND_MESSAGE, stringBody, topicArn, e);
}


Expand Down Expand Up @@ -713,7 +716,7 @@ private <T extends Serializable> void sendMessageToLocalRegionSync(final T body)
url);
}
} catch (Exception e) {
logger.error("Failed to send this message {}. To this address {}. Error was ", messageRequest.getMessageBody(), url, e);
logger.error(FAILED_TO_SEND_MESSAGE, messageRequest.getMessageBody(), url, e);
sendMessageToLocalRegionAsync(body);
}

Expand All @@ -740,7 +743,7 @@ private <T extends Serializable> void sendMessageToLocalRegionAsync(final T body

@Override
public void onError( final Exception e ) {
logger.error("Failed to send this message {}. To this address {}. Error was ", stringBody, url, e);
logger.error(FAILED_TO_SEND_MESSAGE, stringBody, url, e);
}


Expand Down

0 comments on commit 4a65910

Please sign in to comment.