Skip to content

Commit

Permalink
prepare for 0.2.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisKujawa committed Dec 10, 2018
1 parent e353412 commit 8f54df6
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 51 deletions.
49 changes: 12 additions & 37 deletions Client-Example/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
// 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.
using GatewayProtocol;
using Grpc.Core;

using System;
using Zeebe.Client;

Expand All @@ -23,47 +22,23 @@ internal class MainClass
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World!");

var server = new Server();
server.Ports.Add(new ServerPort("localhost", 26500, ServerCredentials.Insecure));

var testService = new GatewayTestService();
var serviceDefinition = Gateway.BindService(testService);
server.Services.Add(serviceDefinition);
server.Start();

var client = ZeebeClient.NewZeebeClient("localhost:26500");

// given

var expectedRequest = new ActivateJobsRequest
{
Timeout = 123L,
Amount = 1,
Type = "foo",
Worker = "jobWorker"
};

var expectedResponse = new ActivateJobsResponse
{
Jobs =
{
new ActivatedJob{Key = 1, JobHeaders = new JobHeaders()},
new ActivatedJob{Key = 2, JobHeaders = new JobHeaders()},
new ActivatedJob{Key = 3, JobHeaders = new JobHeaders()}
}
};

testService.AddRequestHandler(typeof(ActivateJobsRequest), request => expectedResponse);


client.NewWorker()
.JobType("foo")
.Handler((jobClient, job) =>
{
Console.WriteLine("Handle job: ");
Console.WriteLine(job.Key);
var jobKey = job.Key;
Console.WriteLine("Handle job: " + jobKey);
if (jobKey % 2 == 0)
{
jobClient.NewCompleteJobCommand(jobKey).Payload("{\"foo\":2}").Send();
}
else
{
jobClient.NewFailCommand(jobKey).Retries(job.Retries - 1).ErrorMessage("Example fail").Send();
}
})
.Limit(5)
.Name("csharpWorker")
Expand Down
14 changes: 8 additions & 6 deletions Client/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//
using System.Resources;
//
// Copyright (c) 2018 camunda services GmbH ([email protected])
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -17,11 +18,11 @@
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.

[assembly: AssemblyTitle("Zeebe-Client")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyTitle("Zeebe C# Client")]
[assembly: AssemblyDescription("Represents an Zeebe C# client.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCompany("camunda services GmbH")]
[assembly: AssemblyProduct("Zeebe C# Client")]
[assembly: AssemblyCopyright("${AuthorCopyright}")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
Expand All @@ -30,7 +31,8 @@
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.2.0")]
[assembly: NeutralResourcesLanguage("en")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
Expand Down
5 changes: 4 additions & 1 deletion Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ProjectGuid>{86325E12-E104-4360-B4F4-B21B30754EF3}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Zeebe.Client</RootNamespace>
<AssemblyName>client</AssemblyName>
<AssemblyName>zb-client</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
Expand Down Expand Up @@ -40,6 +40,9 @@
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\x64\Release\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
Expand Down
29 changes: 29 additions & 0 deletions Client/Client.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0"?>
<package >
<metadata>
<id>zb-client</id>
<version>0.2.0</version>
<title>Zeebe C# client</title>
<authors>Christopher Zell</authors>
<owners>Zelldon</owners>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
<projectUrl>https://github.com/zeebe-io/zb-csharp-client</projectUrl>
<iconUrl>http://zeebe.io/img/zeebe-logo.svg</iconUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>

<description>
Represents an Zeebe C# client.

Uses GRPC as protocol to communicate with the Zeebe Broker.
For more information about the zeebe project please visit http://zeebe.io
</description>
<releaseNotes>
Zeebe C# client was rewritten and now uses the GRPC protocol to communicate with the broker.
Contains the core functionallity like: complete, fail a job and to create an job worker in C#.

This release is based on the zeebe 0.14.0 release (https://github.com/zeebe-io/zeebe).
</releaseNotes>
<summary>Client to communicate with an zeebe broker.</summary>
<tags>zeebe, zb, zb-csharp, zb-client</tags>
</metadata>
</package>
10 changes: 4 additions & 6 deletions Zeebe.sln
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,22 @@ Global
{86325E12-E104-4360-B4F4-B21B30754EF3}.Debug|x64.Build.0 = Debug|x64
{86325E12-E104-4360-B4F4-B21B30754EF3}.Debug|x86.ActiveCfg = Debug|x86
{86325E12-E104-4360-B4F4-B21B30754EF3}.Debug|x86.Build.0 = Debug|x86
{86325E12-E104-4360-B4F4-B21B30754EF3}.Release|x64.ActiveCfg = Release|x86
{86325E12-E104-4360-B4F4-B21B30754EF3}.Release|x64.ActiveCfg = Release|x64
{86325E12-E104-4360-B4F4-B21B30754EF3}.Release|x64.Build.0 = Release|x64
{86325E12-E104-4360-B4F4-B21B30754EF3}.Release|x86.ActiveCfg = Release|x86
{86325E12-E104-4360-B4F4-B21B30754EF3}.Release|x86.Build.0 = Release|x86
{98FB2560-2C8F-4A55-AD83-5D004F6833DC}.Debug|x64.ActiveCfg = Debug|x64
{98FB2560-2C8F-4A55-AD83-5D004F6833DC}.Debug|x64.Build.0 = Debug|x64
{98FB2560-2C8F-4A55-AD83-5D004F6833DC}.Debug|x86.ActiveCfg = Debug|Any CPU
{98FB2560-2C8F-4A55-AD83-5D004F6833DC}.Debug|x86.Build.0 = Debug|Any CPU
{98FB2560-2C8F-4A55-AD83-5D004F6833DC}.Release|x64.ActiveCfg = Release|Any CPU
{98FB2560-2C8F-4A55-AD83-5D004F6833DC}.Release|x64.Build.0 = Release|Any CPU
{98FB2560-2C8F-4A55-AD83-5D004F6833DC}.Release|x64.ActiveCfg = Release|x64
{98FB2560-2C8F-4A55-AD83-5D004F6833DC}.Release|x86.ActiveCfg = Release|Any CPU
{98FB2560-2C8F-4A55-AD83-5D004F6833DC}.Release|x86.Build.0 = Release|Any CPU
{5A429B91-AC70-418D-93B6-A72E9D75B2C3}.Debug|x64.ActiveCfg = Debug|x64
{5A429B91-AC70-418D-93B6-A72E9D75B2C3}.Debug|x64.Build.0 = Debug|x64
{5A429B91-AC70-418D-93B6-A72E9D75B2C3}.Debug|x86.ActiveCfg = Debug|x86
{5A429B91-AC70-418D-93B6-A72E9D75B2C3}.Debug|x86.Build.0 = Debug|x86
{5A429B91-AC70-418D-93B6-A72E9D75B2C3}.Release|x64.ActiveCfg = Release|x86
{5A429B91-AC70-418D-93B6-A72E9D75B2C3}.Release|x64.ActiveCfg = Release|x64
{5A429B91-AC70-418D-93B6-A72E9D75B2C3}.Release|x86.ActiveCfg = Release|x86
{5A429B91-AC70-418D-93B6-A72E9D75B2C3}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion gateway-protocol/csharp-protocol/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<dependency>
<groupId>io.zeebe</groupId>
<artifactId>zeebe-gateway-protocol</artifactId>
<version>0.14.0-SNAPSHOT</version>
<version>0.14.0</version>
<type>jar</type>
</dependency>
</dependencies>
Expand Down

0 comments on commit 8f54df6

Please sign in to comment.