Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "weekly"
11 changes: 0 additions & 11 deletions .github/pull_request_template.md

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/maven-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Maven Unit Tests

on:
push:

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: [11, 17]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java }}
cache: maven

- name: Run unit tests
run: mvn -B -ntp test
34 changes: 34 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Java CI with Maven

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
51 changes: 20 additions & 31 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<name>Java Stitch Client</name>
<groupId>com.stitchdata</groupId>
<groupId>de.spendit</groupId>
<artifactId>java-stitch-client</artifactId>
<description>Java Stitch Client</description>
<version>0.5.6-SNAPSHOT</version>
<url>https://github.com/stitchdata/java-stitch-client</url>
<version>1.0.0.</version>
<url>https://github.com/Spendit-AG/java-stitch-client</url>
<scm>
<url>https://github.com/stitchdata/java-stitch-client</url>
<connection>scm:git:git@github.com:stitchdata/java-stitch-client.git</connection>
<url>https://github.com/Spendit-AG/java-stitch-client</url>
<connection>scm:git:git@github.com:Spendit-AG/java-stitch-client.git</connection>
<tag>\</tag>
</scm>
<developers>
<developer>
<id>miked@stitchdata.com</id>
<name>Mike DeLaurentis</name>
<email>miked@stitchdata.com</email>
<organization>Stitch</organization>
<organizationUrl>http://stitchdata.com</organizationUrl>
</developer>
</developers>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
Expand All @@ -31,7 +22,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<version>3.4.0</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -44,7 +35,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<version>3.12.0</version>
<configuration>
<failOnError>false</failOnError>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -53,11 +47,11 @@
</goals>
</execution>
</executions>
</plugin>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<version>3.2.8</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand All @@ -71,7 +65,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<version>1.7.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand All @@ -82,7 +76,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5</version>
<version>3.3.1</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<useReleaseProfile>false</useReleaseProfile>
Expand Down Expand Up @@ -118,28 +112,23 @@
<dependency>
<groupId>com.cognitect</groupId>
<artifactId>transit-java</artifactId>
<version>0.8.311</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>fluent-hc</artifactId>
<version>4.5.2</version>
<version>1.1.403</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.0.4</version>
<artifactId>jakarta.json</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
</dependencies>

<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
</project>
73 changes: 0 additions & 73 deletions src/main/java/com/stitchdata/client/examples/CallbackExample.java

This file was deleted.

64 changes: 0 additions & 64 deletions src/main/java/com/stitchdata/client/examples/SimpleExample.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
package com.stitchdata.client;
package de.spendit.stitchdata.client;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.LinkedList;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import com.cognitect.transit.Writer;
import com.cognitect.transit.TransitFactory;
import com.cognitect.transit.Reader;

public class Buffer {

Expand All @@ -31,9 +24,9 @@ synchronized List<Entry> take(int batchSizeBytes, int batchDelayMillis) {
}

boolean ready =
availableBytes >= batchSizeBytes ||
queue.size() >= MAX_MESSAGES_PER_BATCH ||
System.currentTimeMillis() - queue.peek().entryTime >= batchDelayMillis;
availableBytes >= batchSizeBytes ||
queue.size() >= MAX_MESSAGES_PER_BATCH ||
System.currentTimeMillis() - queue.peek().entryTime >= batchDelayMillis;

if (!ready) {
return null;
Expand All @@ -44,7 +37,7 @@ synchronized List<Entry> take(int batchSizeBytes, int batchDelayMillis) {
// Start size at 2 to allow for opening and closing brackets
int size = 2;
while (!queue.isEmpty() &&
size + queue.peek().bytes.length < MAX_BATCH_SIZE_BYTES) {
size + queue.peek().bytes.length < MAX_BATCH_SIZE_BYTES) {
Entry entry = queue.remove();
// Add size of record plus the comma delimiter
size += entry.bytes.length + 1;
Expand All @@ -69,8 +62,8 @@ static class Entry {
// We need two extra bytes for the [ and ] wrapping the record.
if (bytes.length > MAX_BATCH_SIZE_BYTES - 2) {
throw new IllegalArgumentException(
"Can't accept a record larger than " + (MAX_BATCH_SIZE_BYTES - 2)
+ " bytes");
"Can't accept a record larger than " + (MAX_BATCH_SIZE_BYTES - 2)
+ " bytes");
}
}
}
Expand Down
Loading