Skip to content

Commit

Permalink
Merge pull request #1 from buildersoftdev/feature/core-structure
Browse files Browse the repository at this point in the history
Feature/core structure
  • Loading branch information
eneshoxha authored Sep 8, 2021
2 parents 44e029e + 50be4ce commit da98e9e
Show file tree
Hide file tree
Showing 26 changed files with 680 additions and 9 deletions.
14 changes: 14 additions & 0 deletions src/Buildersoft.Messaging/Abstraction/IMessagingClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Buildersoft.Messaging.Builder;
using Microsoft.Extensions.Logging;
using System;

namespace Buildersoft.Messaging.Abstraction
{
public interface IMessagingClient
{
IMessagingClient GetClient();
IMessagingClient Build();
MessagingClientBuilder GetBuilder();
ILoggerFactory GetLoggerFactory();
}
}
20 changes: 20 additions & 0 deletions src/Buildersoft.Messaging/Abstraction/IMessagingConsumer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Andy.X.Client.Events.Consumers;
using System.Threading;

namespace Buildersoft.Messaging.Abstraction
{
public interface IMessagingConsumer<T>
{
delegate bool MessageReceivedHandler(object sender, MessageReceivedArgs<T> messageReceivedArgs);
event MessageReceivedHandler MessageReceived;

delegate void StatusChangedHandler(object sender, string status);
event StatusChangedHandler StatusChanged;

void StopConsuming();
void StartConsuming();
string GetInitializedConsumerName();
string GetConsumerState();
CancellationTokenSource GetCancellationTokenSource();
}
}
15 changes: 15 additions & 0 deletions src/Buildersoft.Messaging/Abstraction/IMessagingProducer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Threading;
using System.Threading.Tasks;

namespace Buildersoft.Messaging.Abstraction
{
public interface IMessagingProducer<T>
{
delegate void StatusChangedHandler(object sender, string status);
event StatusChangedHandler StatusChanged;

Task<Guid> SendAsync(T tEntity, string key = "");
CancellationTokenSource GetCancellationTokenSource();
}
}
29 changes: 29 additions & 0 deletions src/Buildersoft.Messaging/App/Andy/AndyClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Buildersoft.Messaging.Abstraction;
using Buildersoft.Messaging.Builder;
using Microsoft.Extensions.Logging;

namespace Buildersoft.Messaging.App.Andy
{
public class AndyClient : IMessagingClient
{
public IMessagingClient Build()
{
throw new System.NotImplementedException();
}

public MessagingClientBuilder GetBuilder()
{
throw new System.NotImplementedException();
}

public IMessagingClient GetClient()
{
throw new System.NotImplementedException();
}

public ILoggerFactory GetLoggerFactory()
{
throw new System.NotImplementedException();
}
}
}
36 changes: 36 additions & 0 deletions src/Buildersoft.Messaging/App/Andy/AndyConsumer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Buildersoft.Messaging.Abstraction;
using System.Threading;

namespace Buildersoft.Messaging.App.Andy
{
public class AndyConsumer<T> : IMessagingConsumer<T>
{
public event IMessagingConsumer<T>.MessageReceivedHandler MessageReceived;
public event IMessagingConsumer<T>.StatusChangedHandler StatusChanged;

public CancellationTokenSource GetCancellationTokenSource()
{
throw new System.NotImplementedException();
}

public string GetConsumerState()
{
throw new System.NotImplementedException();
}

public string GetInitializedConsumerName()
{
throw new System.NotImplementedException();
}

public void StartConsuming()
{
throw new System.NotImplementedException();
}

public void StopConsuming()
{
throw new System.NotImplementedException();
}
}
}
22 changes: 22 additions & 0 deletions src/Buildersoft.Messaging/App/Andy/AndyProducer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Buildersoft.Messaging.Abstraction;
using System;
using System.Threading;
using System.Threading.Tasks;

namespace Buildersoft.Messaging.App.Andy
{
public class AndyProducer<T> : IMessagingProducer<T>
{
public event IMessagingProducer<T>.StatusChangedHandler StatusChanged;

public CancellationTokenSource GetCancellationTokenSource()
{
throw new NotImplementedException();
}

public Task<Guid> SendAsync(T tEntity, string key = "")
{
throw new NotImplementedException();
}
}
}
29 changes: 29 additions & 0 deletions src/Buildersoft.Messaging/App/Kafka/KafkaClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Buildersoft.Messaging.Abstraction;
using Buildersoft.Messaging.Builder;
using Microsoft.Extensions.Logging;

namespace Buildersoft.Messaging.App.Kafka
{
public class KafkaClient : IMessagingClient
{
public IMessagingClient Build()
{
throw new System.NotImplementedException();
}

public MessagingClientBuilder GetBuilder()
{
throw new System.NotImplementedException();
}

public IMessagingClient GetClient()
{
throw new System.NotImplementedException();
}

public ILoggerFactory GetLoggerFactory()
{
throw new System.NotImplementedException();
}
}
}
36 changes: 36 additions & 0 deletions src/Buildersoft.Messaging/App/Kafka/KafkaConsumer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Buildersoft.Messaging.Abstraction;
using System.Threading;

namespace Buildersoft.Messaging.App.Kafka
{
public class KafkaConsumer<T> : IMessagingConsumer<T>
{
public event IMessagingConsumer<T>.MessageReceivedHandler MessageReceived;
public event IMessagingConsumer<T>.StatusChangedHandler StatusChanged;

public CancellationTokenSource GetCancellationTokenSource()
{
throw new System.NotImplementedException();
}

public string GetConsumerState()
{
throw new System.NotImplementedException();
}

public string GetInitializedConsumerName()
{
throw new System.NotImplementedException();
}

public void StartConsuming()
{
throw new System.NotImplementedException();
}

public void StopConsuming()
{
throw new System.NotImplementedException();
}
}
}
22 changes: 22 additions & 0 deletions src/Buildersoft.Messaging/App/Kafka/KafkaProducer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Buildersoft.Messaging.Abstraction;
using System;
using System.Threading;
using System.Threading.Tasks;

namespace Buildersoft.Messaging.App.Kafka
{
public class KafkaProducer<T> : IMessagingProducer<T>
{
public event IMessagingProducer<T>.StatusChangedHandler StatusChanged;

public CancellationTokenSource GetCancellationTokenSource()
{
throw new NotImplementedException();
}

public Task<Guid> SendAsync(T tEntity, string key = "")
{
throw new NotImplementedException();
}
}
}
29 changes: 29 additions & 0 deletions src/Buildersoft.Messaging/App/Pulsar/PulsarClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Buildersoft.Messaging.Abstraction;
using Buildersoft.Messaging.Builder;
using Microsoft.Extensions.Logging;

namespace Buildersoft.Messaging.App.Pulsar
{
public class PulsarClient : IMessagingClient
{
public IMessagingClient Build()
{
throw new System.NotImplementedException();
}

public MessagingClientBuilder GetBuilder()
{
throw new System.NotImplementedException();
}

public IMessagingClient GetClient()
{
throw new System.NotImplementedException();
}

public ILoggerFactory GetLoggerFactory()
{
throw new System.NotImplementedException();
}
}
}
36 changes: 36 additions & 0 deletions src/Buildersoft.Messaging/App/Pulsar/PulsarConsumer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Buildersoft.Messaging.Abstraction;
using System.Threading;

namespace Buildersoft.Messaging.App.Pulsar
{
public class PulsarConsumer<T> : IMessagingConsumer<T>
{
public event IMessagingConsumer<T>.MessageReceivedHandler MessageReceived;
public event IMessagingConsumer<T>.StatusChangedHandler StatusChanged;

public CancellationTokenSource GetCancellationTokenSource()
{
throw new System.NotImplementedException();
}

public string GetConsumerState()
{
throw new System.NotImplementedException();
}

public string GetInitializedConsumerName()
{
throw new System.NotImplementedException();
}

public void StartConsuming()
{
throw new System.NotImplementedException();
}

public void StopConsuming()
{
throw new System.NotImplementedException();
}
}
}
22 changes: 22 additions & 0 deletions src/Buildersoft.Messaging/App/Pulsar/PulsarProducer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Buildersoft.Messaging.Abstraction;
using System;
using System.Threading;
using System.Threading.Tasks;

namespace Buildersoft.Messaging.App.Pulsar
{
public class PulsarProducer<T> : IMessagingProducer<T>
{
public event IMessagingProducer<T>.StatusChangedHandler StatusChanged;

public CancellationTokenSource GetCancellationTokenSource()
{
throw new NotImplementedException();
}

public Task<Guid> SendAsync(T tEntity, string key = "")
{
throw new NotImplementedException();
}
}
}
14 changes: 14 additions & 0 deletions src/Buildersoft.Messaging/Builder/MessagingClientBuilder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Buildersoft.Messaging.Configuration;

namespace Buildersoft.Messaging.Builder
{
public class MessagingClientBuilder
{
public MessagingClientConfiguration MessagingConfiguration { get; private set; }

public MessagingClientBuilder(MessagingClientConfiguration messagingConfiguration)
{
MessagingConfiguration = messagingConfiguration;
}
}
}
14 changes: 14 additions & 0 deletions src/Buildersoft.Messaging/Builder/MessagingConsumerBuilder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Buildersoft.Messaging.Configuration;

namespace Buildersoft.Messaging.Builder
{
public class MessagingConsumerBuilder<T>
{
public MessagingConsumerConfiguration<T> MessagingConsumerConfiguration { get; private set; }

public MessagingConsumerBuilder(MessagingConsumerConfiguration<T> messagingConsumerConfiguration)
{
MessagingConsumerConfiguration = messagingConsumerConfiguration;
}
}
}
14 changes: 14 additions & 0 deletions src/Buildersoft.Messaging/Builder/MessagingProducerBuilder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Buildersoft.Messaging.Configuration;

namespace Buildersoft.Messaging.Builder
{
public class MessagingProducerBuilder<T>
{
public MessagingProducerConfiguration<T> MessagingProducerConfiguration { get; private set; }

public MessagingProducerBuilder(MessagingProducerConfiguration<T> messagingProducerConfiguration)
{
MessagingProducerConfiguration = messagingProducerConfiguration;
}
}
}
7 changes: 7 additions & 0 deletions src/Buildersoft.Messaging/Buildersoft.Messaging.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,11 @@
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Buildersoft.Andy.X.Client" Version="2.0.2-preview" />
<PackageReference Include="Confluent.Kafka" Version="1.7.0" />
<PackageReference Include="DotPulsar" Version="1.1.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
</ItemGroup>

</Project>
9 changes: 0 additions & 9 deletions src/Buildersoft.Messaging/Class1.cs

This file was deleted.

Loading

0 comments on commit da98e9e

Please sign in to comment.