Title | github_url | Weight | Description |
---|---|---|---|
ProconTEL SDK |
8 |
Learn how to use the ProconTEL SDK
|
- Quick introduction
- Compatibility matrix
- SDK major changes
- Builder blocks
- Injected services
- Providers
- Attributes
- Advanced concepts
- UI Components
- Injected services for UI Components
- IoC
- Middlewares
- Using ProconTel API with SDK
- Legacy Sdk
- Standard Endpoints
ProconTEL.Sdk
is a modern .NET Standard SDK for porting your business logic with ProconTEL environment. The modular design and middleware oriented architecture makes the endpoint highly customizable while providing sensible default for topology, communication and extensions. Documentation for version 1.x is currently available under docs
.
As SDK version may change, we provide SDK compatibility matrix which shows which SDK versions is supported by which ProconTEL Engine.
ProconTEL SDK version | ProconTEL Engine major version(s) |
---|---|
1.0.10 | 3.4.3 |
1.0.9 | 3.4.2 |
1.0.8 | 3.4.1.4 |
1.0.7 | 3.4.1.3 |
1.0.6 | 3.4.0 RC |
1.0.5 | 3.0.17 - 3.3.8 |
1.0.4 | 3.0.16 |
1.0.3 | 3.0.15 |
1.0.2 | 3.0.13 - 3.0.14 |
1.0.1 | 3.0.11 - 3.0.12 |
1.0.0 | 3.0.9 - 3.0.10 |
0.11.0 | 3.0.8 |
0.10.0 | 3.0.7 |
0.9.0 | 3.0.6 |
0.8.0 | 3.0.5 |
0.7.0 | 3.0.4 |
0.6.0 | 3.0.3 |
0.5.0 | 3.0.2 |
Task ID | Topic | Changes |
---|---|---|
PS-1214 | IMetadataContext | Add information about endpoint isolation |
PS-1556 | All interfaces | Replace async methods with synchronous implementation |
Task ID | Topic | Changes |
---|---|---|
PS-1499 | IMessageObserver | Changed the type of endpointId from string to GuidId |
Task ID | Topic | Changes |
---|---|---|
PS-1545 | ILogger | Removed the warning about the logger getting overriden if the loggers have the same references |
Task ID | Topic | Changes |
---|---|---|
PS-1223 | IReportService | Changed the type of endpointId from string to GuidId |
PS-1392 | SDK.UI.Configuration | Fixing subscribers editor control when used from custom configuration dialog. |
Task ID | Topic | Changes |
---|---|---|
PS-1230 | Legacy.Logging.Logger | Added possibility to set an instance inside the endpoint created in the new SDK |
PS-1254 | ICommandHandler | Added TaskCanceledException handling in HandleCommandAsync when the function returns null |
A endpoint has a lifecycle managed by ProconTEL. ProconTEL.Sdk offers interface IEndpointLifeTimeCycle
that provide visibility into these key life moments and the ability to act when they occur. It also allows customization of default ProconTEL input pipeline for receiving messages. For more information see Middlewares.
[EndpointMetadata(Name = "LifeTimeCycle", SupportedRoles = SupportedRoles.Both)]
public class LifeTimeCycleEndpoint : IEndpointLifeTimeCycle
{
private readonly ILogger _logger;
public LifeTimeCycleEndpoint(ILogger logger) => _logger = logger;
public void Initialize(IMiddlewareBuilder builder)
{
_logger.Information("Initialize");
}
public void AfterActivate()
{
_logger.Information("After Activate");
}
public void Terminate()
{
_logger.Information("Terminate");
}
}
IHandler
is common communication interface which provide receiving data from another endpoint. We can filter incoming messages by implement method IHandler.CanHandle
.
Method Handle
is responsible for processing data. This execution is a blocking call (synchronous). No execution will take place on the current thread until current processing returns some acknowledgement. We will not process new messages until the current processing is completed.
We support few acknowledgement types : Ack, Retry, Reject. Handler implementation has to return acknowledgement (mandatory), but sender can ignore it (obligatory).
[EndpointMetadata(Name = "Handler", SupportedRoles = SupportedRoles.Subscriber)]
[DefaultProtocol]
public class HandlerEndpoint : IHandler
{
private readonly ILogger _logger;
public HandlerEndpoint(ILogger logger) => _logger = logger;
public bool CanHandle(string messageId, ICorrelationContext context = null) => true;
public Acknowledgement Handle(string messageId, object message, ICorrelationContext context)
{
_logger.Information($"Received id: {messageId}, message: {message}");
return new Ack();
}
}
Interface ICommandHandler
support handling messages from Status Control Component. Processing approach is similar like in IHandler.
[EndpointMetadata(Name = "CommandHandler", SupportedRoles = SupportedRoles.None)]
public class CommandHandlerEndpoint : ICommandHandler
{
private readonly ILogger _logger;
public CommandHandlerEndpoint(ILogger logger) => _logger = logger;
public object HandleCommand(object command, ICorrelationContext context = null)
{
_logger.Information($"Received command: {command}");
return "Done";
}
}
Interface IConfigurationCommandHandler
support handling messages from Configuration Dialog Component. Configuration Command Handler mechanism will soon be deprecated.
[Obsolete("Configuration Command Handler mechanism will soon be deprecated.")]
[EndpointMetadata(Name = "ConfigurationCommandHandler", SupportedRoles = SupportedRoles.None)]
public class ConfigurationCommandHandlerEndpoint : IConfigurationCommandHandler
{
private readonly ILogger _logger;
public ConfigurationCommandHandlerEndpoint(ILogger logger) => _logger = logger;
public object HandleConfigurationCommand(object command, ICorrelationContext context = null)
{
_logger.Information($"Execute command {command}");
return "Done";
}
}
Interface IOnlineConfigurationUpdate
support observe configuration changed notification. To read current configuration version use IConfigurationReader
service injection.
[EndpointMetadata(Name = "OnlineConfigurationUpdate", SupportedRoles = SupportedRoles.None)]
public class OnlineConfigurationUpdateEndpoint : IOnlineConfigurationUpdate
{
private readonly ILogger _logger;
private readonly IConfigurationReader _configurationReader;
public OnlineConfigurationUpdateEndpoint(ILogger logger, IConfigurationReader configurationReader)
{
_logger = logger;
_configurationReader = configurationReader;
}
public void ConfigurationChanged()
{
_logger.Information($"Configuration was changed. Current values: {_configurationReader.GetConfiguration()})");
}
}
Interface IOnlineUpgradeLifetimeCycle
support visibility into upgrade plugin process and the ability to act when they occur.
The plugin has to possess a .NET strong name(add key.snk to your soultion).
[EndpointMetadata(Name = "OnlineUpgradeLifetimeCycle", SupportedRoles = SupportedRoles.None)]
public class OnlineUpgradeLifetimeCycleEndpoint : IOnlineUpgradeLifetimeCycle
{
private readonly ILogger _logger;
private readonly IRuntimeContext _runtimeContext;
public OnlineUpgradeLifetimeCycleEndpoint(ILogger logger, IRuntimeContext runtimeContext)
{
_logger = logger;
_runtimeContext = runtimeContext;
}
public void AfterUpgrade()
{
_logger.Information($"Update endpoint finished (id: {_runtimeContext.MetadataContext.Id})");
}
public bool CanUpgrade() => true;
}
IAvatarInsight
is an interface that allows to handle avatar connection and disconnection events in avatar source endpoint.
[EndpointMetadata(Name = "Avatar Insight Endpoint", SupportedRoles = SupportedRoles.None)]
class AvatarInsightEndpoint : IAvatarsInsight
{
private ILogger Logger;
public AvatarInsightEndpoint(ILogger logger)
{
Logger = logger;
}
public void AvatarConnected(IAvatarConfiguration avatarConfiguration)
{
Logger.Information($"Avatar has been connected");
}
public void AvatarDisconnected(IAvatarConfiguration avatarConfiguration)
{
Logger.Information($"Avatar has been disconnected");
}
}
Interface IFileHandler
allows handling of uploaded files from client to server backend.
[EndpointMetadata(Name = "FileReceiver", SupportedRoles = SupportedRoles.None)]
public class FileReceiverEndpoint : IFileHandler
{
private readonly ILogger _logger;
public FileReceiverEndpoint(ILogger logger)
{
_logger = logger;
}
public object HandleFile(IUploadedFiles uploadedFiles)
{
_logger.Information($"Execute {nameof(HandleFile)}. Uploaded files: {String.Join(",", uploadedFiles.TransferedFiles)}.");
return new object();
}