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

Shade the jar, adds Main.java entrypoint #3

Merged
merged 8 commits into from
Apr 3, 2024

Conversation

StrongestNumber9
Copy link

No description provided.

isConnected = false;
}

private void sendMessage(String message, Map<String, String> headers) {
Copy link
Member

Choose a reason for hiding this comment

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

move this to RelpConversion

@@ -104,6 +118,7 @@ private FullHttpResponse processMessage() {
final Map<String, String> formattedHeaders = formatHeaders(req.headers());
final String body = req.content().toString(UTF8_CHARSET);
if (messageHandler.onNewMessage(remoteAddress, formattedHeaders, body)) {
sendMessage(body, formattedHeaders);
Copy link
Member

Choose a reason for hiding this comment

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

this to RelpConversion

@@ -162,4 +177,90 @@ private Map<String, String> formatHeaders(HttpHeaders headers) {
formattedHeaders.put("http_version", req.protocolVersion().text());
return formattedHeaders;
}

private void connect() {
Copy link
Member

Choose a reason for hiding this comment

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

this to RelpConversion too, note that copy should create a new Connection too.

private final static Logger LOGGER = LogManager.getLogger(MessageHandler.class);
private final RelpConnection relpConnection;
Copy link
Member

Choose a reason for hiding this comment

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

to RelpConversion

}

public boolean onNewMessage(String remoteAddress, Map<String, String> headers, String body) {
sendMessage(body, headers);
Copy link
Member

@kortemik kortemik Apr 3, 2024

Choose a reason for hiding this comment

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

use
boolean rv;
try {
send
rv = true;
}
catch (Exception e) {
LOGGER.error("", e);
rv = false;
}
return rv;

}

public boolean requiresToken() {
return false;
Copy link
Member

Choose a reason for hiding this comment

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

make this configureable

}

public boolean validatesToken(String token) {
return true;
Copy link
Member

Choose a reason for hiding this comment

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

make this configureable, single string.equals(token)

@kortemik kortemik merged commit b8eccb1 into teragrep:main Apr 3, 2024
1 check passed
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.

2 participants