Skip to content
This repository was archived by the owner on Apr 22, 2024. It is now read-only.

Comments

[PIR-23] Increase maximum allowed data age for event replay#20

Closed
julianmclain wants to merge 3 commits intomasterfrom
jm-iterable/support-event-replay
Closed

[PIR-23] Increase maximum allowed data age for event replay#20
julianmclain wants to merge 3 commits intomasterfrom
jm-iterable/support-event-replay

Conversation

@julianmclain
Copy link

@julianmclain julianmclain commented Jun 3, 2020

Summary

  • Updates the IterableLambdaFunction in order to support HTTP requests / responses
  • Removes limit on maximum data age (also see Update allowed maximum data age to 30 days #4 )
  • Adds eventIds to /api/events/track and /api/commerce/trackPurchase events
  • Updates Iterable request error handling so that the Lambda will return a 429 status code if it receives one from Iterable

@julianmclain julianmclain self-assigned this Jun 3, 2020
throw new IOException(iterableResponse.body().toString());
} else if (!iterableResponse.isSuccessful()) {
if (iterableResponse.code() == 429 ) {
IterableLambdaResponse lambdaResponse = new IterableLambdaResponse();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to do anything. I think you'll need to pull this into IterableLambdaEndpoint

Event.Type.PRODUCT_ACTION);

// Specify maximum data age (especially relevant for Event Replays)
eventProcessingRegistration.setMaxDataAgeHours(365*24);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
eventProcessingRegistration.setMaxDataAgeHours(365*24);
eventProcessingRegistration.setMaxDataAgeHours(-1);

To make it unlimited

}

TrackRequest request = new TrackRequest(event.getName());
request.id = event.getId().toString();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is getId() nullable? If so, I'd add a null check.

@julianmclain julianmclain changed the base branch from master to develop June 5, 2020 05:37
} catch (IOException e) {
Map<String, String> body = new HashMap<>();
body.put("message", e.getMessage());
ErrorResponse error = new ErrorResponse(500, body);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if we return this, Lambda metrics will start showing those requests as successful because they don't throw exceptions. It may be better to let the exception through for monitoring unless we know we can track them downstream.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good call. I'll stop catching those exceptions unless we get another form of monitoring setup.

Base automatically changed from develop to master August 3, 2020 15:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants