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

WIP: Support outgoing tracking of requests with Java #8

Merged
merged 22 commits into from May 16, 2019

Conversation

matthewoates
Copy link
Contributor

@matthewoates matthewoates commented May 14, 2019

Some outstanding questions:

  • It still makes sense to track transactionId right? I can add a getTransactionId hook
  • Do I need to call ipAddress and leverage similar logic to https://github.com/Moesif/moesif-servlet/blob/master/moesif-servlet/src/main/java/com/moesif/servlet/utils/IpAddress.java ?
  • I don't think the response body parsing is very versatile. What would you recommend here when working with something as generic as an InputStream?
  • Is transferEncoding still needed?
  • Should we add an apiToken hook? It doesn't look like it's used in servlet.
  • What's best practice for logging warnings / errors? System.out.println with a debug option in config that defaults to false?

TODO:

  • hook up apiVersion hook
  • migrate local testing code into separate example repo

@dgilling
Copy link
Member

Ignore TransactionId.
Yes, we should still grab the address like we do in Express and Python since it's dependent on the header, env.
transferEncoding is needed when body is not JSON. We use it to base64 encode the binary data. This means transferEncoding is set to 'base64'
See: https://www.moesif.com/docs/api#events and https://github.com/Moesif/moesif-express/blob/master/lib/index.js

@dgilling
Copy link
Member

You can use that or import something like log4j or java.util.logging

return eventResponseBuilder.build();
}

private EventResponseModel buildEventResponseModel(Exception e) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dgilling is this how we should handle requests that fail? I think they should be reported to moesif somehow. 500 probably isn't the right status code either.

@dgilling dgilling merged commit 1568599 into master May 16, 2019
@praves77 praves77 deleted the moesif-java-request branch March 29, 2023 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants