Skip to content

Commit a96cae0

Browse files
Adds github workflow, builds on java 8+, adds readme (#2)
1 parent aa341b3 commit a96cae0

4 files changed

Lines changed: 81 additions & 24 deletions

File tree

.github/workflows/release.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish
2+
on:
3+
release:
4+
types: [created]
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Set up JDK 8
18+
uses: actions/setup-java@v3
19+
with:
20+
java-version: '8'
21+
distribution: 'temurin'
22+
server-id: github
23+
settings-path: ${{ github.workspace }}
24+
25+
- name: Publish to GitHub Packages
26+
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy -Ppublish-github-packages
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
30+
31+
- name: Pack RPM
32+
run: cd rpm/ && mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= -f rpm.pom.xml package
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
36+
37+
- name: Attach rpm to release
38+
uses: softprops/action-gh-release@v1
39+
with:
40+
files: rpm/target/rpm/com.teragrep-rlp_09/RPMS/noarch/com.teragrep-rlp_09-*.noarch.rpm

README.adoc

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,50 @@
1-
// Before publishing your new repository:
2-
// 1. Write the readme file
3-
// 2. Update the issues link in Contributing section in the readme file
4-
// 3. Update the discussion link in config.yml file in .github/ISSUE_TEMPLATE directory
1+
# RELP Flooder rlp_09
52

6-
# repo-template
3+
Simple but scalable RELP flooder
74

8-
// Add a short description of your project. Tell what your project does and what it's used for.
5+
## Features
96

10-
This is a template repository for Teragrep organization.
7+
- Simple to set up
8+
- Simple to use
9+
- Gives statistics
10+
- Scales to as many threads as wanted
1111
12-
## Features
12+
## Limitations
1313

14-
// List your project's features
14+
- No structured data support yet
15+
- No TLS support yet
16+
- No customizable message support yet
17+
- Supports only RFC5424
1518
16-
## Documentation
19+
## How to compile
1720

18-
See the official documentation on https://docs.teragrep.com[docs.teragrep.com].
21+
`mvn clean package`
1922

20-
## Limitations
23+
## How to run
2124

22-
// If your project has limitations, please list them. Otherwise remove this section.
25+
`java -jar rlp_09.jar`
2326

24-
## How to [compile/use/implement]
27+
## Configurations
2528

26-
// add instructions how people can start to use your project
2729

28-
## Contributing
30+
[cols="3"]
31+
|===
32+
|System property|Default value|Usage
33+
34+
|hostname|localhost|Sets hostname for the event
35+
|appname|rlp_09|Sets used appname for the event
36+
|target|127.0.0.1|RELP target server
37+
|port|1601|RELP target port
38+
|threads|4|RELP Flooder thread count
39+
|useTls|false|Is TLS used for connections
40+
|payloadSize|10|Event message payload size (excludes any headers)
41+
|batchSize|1|How many events is sent in one batch
2942

30-
// Change the repository name in the issues link to match with your project's name
43+
|===
44+
45+
## Contributing
3146

32-
You can involve yourself with our project by https://github.com/teragrep/repo-template/issues/new/choose[opening an issue] or submitting a pull request.
47+
You can involve yourself with our project by https://github.com/teragrep/rlp_09/issues/new/choose[opening an issue] or submitting a pull request.
3348

3449
Contribution requirements:
3550

@@ -42,6 +57,6 @@ Read more in our https://github.com/teragrep/teragrep/blob/main/contributing.ado
4257

4358
### Contributor License Agreement
4459

45-
Contributors must sign https://github.com/teragrep/teragrep/blob/main/cla.adoc[Teragrep Contributor License Agreement] before a pull request is accepted to organization's repositories.
60+
Contributors must sign https://github.com/teragrep/teragrep/blob/main/cla.adoc[Teragrep Contributor License Agreement] before a pull request is accepted to organization's repositories.
4661

47-
You need to submit the CLA only once. After submitting the CLA you can contribute to all Teragrep's repositories.
62+
You need to submit the CLA only once. After submitting the CLA you can contribute to all Teragrep's repositories.

pom.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
<name>rlp_09</name>
88
<properties>
99
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
10-
<maven.compiler.source>17</maven.compiler.source>
11-
<maven.compiler.target>17</maven.compiler.target>
12-
<java.version>17</java.version>
10+
<maven.compiler.source>8</maven.compiler.source>
11+
<maven.compiler.target>8</maven.compiler.target>
12+
<java.version>8</java.version>
1313
<revision>0.0.1</revision>
1414
<changelist>-SNAPSHOT</changelist>
1515
<sha1/>
@@ -113,6 +113,8 @@
113113
<version>3.12.1</version>
114114
<configuration>
115115
<compilerArgument>-Xlint:all</compilerArgument>
116+
<source>${java.version}</source>
117+
<target>${java.version}</target>
116118
</configuration>
117119
</plugin>
118120
<plugin>

src/main/java/com/teragrep/rlp_09/RelpConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class RelpConfig {
8383
.withHostname(this.hostname)
8484
.withFacility(Facility.USER)
8585
.withSeverity(Severity.INFORMATIONAL)
86-
.withMsg("X".repeat(this.payloadSize))
86+
.withMsg(new String(new char[this.payloadSize]).replace("\0", "X"))
8787
.toRfc5424SyslogMessage()
8888
.getBytes(StandardCharsets.UTF_8);
8989
this.messageLength = message.length;

0 commit comments

Comments
 (0)