forked from logstash-plugins/logstash-input-http
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #64: Rebind RELP connections after configurable amount of message…
…s have been sent (#66) * Open a new RELP connection after a certain amount of messages have been sent with it. Two new configuration parameters for rebinding. * Refactor counting sent records to IRelpConnection * Add more rebind tests for RelpConnectionPool * Refactor rebinding to a decorator, use generic Pool with managedRelpConnection * Remove unnecessary function already defined in extending interface, apply spotless * Add test for rebind * Remove unnecessary functions from IManagedRelpConnection interface, create new rebind tests * Change ManagedRelpConnection to only follow has been a connection made atleast once and not the connection itself. Change counter in CountingFrameDelegate to AtomicInteger. * Fix hasConnected in ManagedRelpConnection * Add tests for invalid rebindRequestAmount system property
- Loading branch information
Showing
22 changed files
with
592 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/java/com/teragrep/lsh_01/pool/IManagedRelpConnection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
logstash-http-input to syslog bridge | ||
Copyright 2024 Suomen Kanuuna Oy | ||
Derivative Work of Elasticsearch | ||
Copyright 2012-2015 Elasticsearch | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
package com.teragrep.lsh_01.pool; | ||
|
||
public interface IManagedRelpConnection extends Poolable { | ||
|
||
void ensureSent(byte[] bytes); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/main/java/com/teragrep/lsh_01/pool/ManagedRelpConnectionStub.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
logstash-http-input to syslog bridge | ||
Copyright 2024 Suomen Kanuuna Oy | ||
Derivative Work of Elasticsearch | ||
Copyright 2012-2015 Elasticsearch | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
package com.teragrep.lsh_01.pool; | ||
|
||
public class ManagedRelpConnectionStub implements IManagedRelpConnection { | ||
|
||
@Override | ||
public void ensureSent(byte[] bytes) { | ||
throw new IllegalStateException("ManagedRelpConnectionStub does not support this"); | ||
} | ||
|
||
@Override | ||
public boolean isStub() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public void close() { | ||
throw new IllegalStateException("ManagedRelpConnectionStub does not support this"); | ||
} | ||
} |
Oops, something went wrong.