Skip to content

Commit 2db09fa

Browse files
author
Danny Logsdon
committed
# 1.4.0
- Rollup Release
1 parent 0ac7e3b commit 2db09fa

35 files changed

Lines changed: 1955 additions & 536 deletions

File tree

ReleaseNotes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 1.4.0
2+
- Rollup Release
3+
14
# 1.4.0-e
25
- Minor fixes
36
- New test home page

src/V1/ServiceBricks.Notification.AzureDataTables/Resource/readme.md

Lines changed: 159 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,182 @@
1-
![ServiceBricks Logo](https://raw.githubusercontent.com/holomodular/ServiceBricks/main/Logo.png)
1+
![ServiceBricks Logo](https://raw.githubusercontent.com/holomodular/ServiceBricks/main/Logo.png)
22

3-
[![NuGet version](https://badge.fury.io/nu/ServiceBricks.svg)](https://badge.fury.io/nu/ServiceBricks)
4-
![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/holomodular-support/bdb5c7c570a7a88ffb3efb3505273e34/raw/servicebricks-codecoverage.json)
3+
[![NuGet version](https://badge.fury.io/nu/ServiceBricks.Notification.Microservice.svg)](https://badge.fury.io/nu/ServiceBricks.Notification.Microservice)
4+
![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/holomodular-support/e48b40f2064d0b0a359109f864c3aff7/raw/servicebricksnotification-codecoverage.json)
55
[![License: MIT](https://img.shields.io/badge/License-MIT-389DA0.svg)](https://opensource.org/licenses/MIT)
66

7-
# ServiceBricks: The Microservices Foundation
7+
# ServiceBricks Notification Microservice
88

99
## Overview
1010

11-
[ServiceBricks](https://ServiceBricks.com) is a powerful microservices platform designed to streamline the development, deployment, and maintenance of distributed systems using artificial intelligence.
12-
Leveraging Domain-Driven Design (DDD), Event-Driven Architecture (EDA), and a host of advanced features, ServiceBricks empowers teams to create scalable, customizable services tailored to specific business domains.
11+
This repository contains the notification microservice built using the ServiceBricks foundation.
12+
The notification microservice is responsible for sending emails and SMS messages from the system.
13+
It provides a background task to process notify messages, along with retry, should external providers not be available when being sent.
14+
It subscribes to service bus messages for email and sms broadcasts, so that the security microservice and others have a default mechanism to send notifications from the system.
1315

14-
## Why ServiceBricks?
16+
### Supported Providers
17+
By default, dependency injection is registered with a dummy email and sms provider that does not send any message but simply logs them using an ILogger<> inteface.
18+
You must explicitly add a line of code and configurations to register the providers below.
19+
You can quickly build your own providers by including the **ServiceBricks.Notification.Model** NuGet package and implementing the IEmailProvider and ISmsProvider interfaces.
1520

16-
* **Artificial Intelligence:** Use our online generator to create production-grade microservices in seconds using only a single human sentence as input.
17-
* **Advanced Architecture:** Provides the core architectural patterns, implementation, standardization, and governance for your microservices.
18-
* **REST APIs:** Expose standardized, secure REST APIs to manage your data.
19-
* **Storage Agnostic:** Interchangeably supports relational, document, cloud or embedded database engines
20-
* **Seamless Integration:** Switch storage providers without impacting microservice operations and avoid vendor lock-in.
2121

22+
#### Email
2223

23-
## Major Features
24+
* SendGrid - Nuget Package - ServiceBricks.Notification.SendGrid
2425

25-
* **Artificial Intelligence Integration:** Use large language models to build, query and manipulate your microservice data using simple human input.
26-
* **Generics:** Extensive use of generics, allowing the compiler to generate most of the required source code.
27-
* **REST API Services:** Templated, repository-based services for quickly exposing standard CRUD+QPV (Query, Patch, Validate) methods or custom methods.
28-
* **[ServiceQuery Integration](https://github.com/holomodular/ServiceQuery):** Supports standardized, polyglot, dynamic data querying for all database engines.
29-
* **[Business Rule Engine](https://github.com/holomodular/ServiceBricks-Documentation/blob/main/V1/BusinessRuleEngine.md):** Polymorphic techniques to build reusable business logic.
30-
* **[Domain-Driven Design (DDD)](https://github.com/holomodular/ServiceBricks-Documentation/blob/main/V1/FlowOfData.md) & [Event-Driven Architecture (EDA)](https://github.com/holomodular/ServiceBricks-Documentation/blob/main/V1/EventDrivenArchitecture.md):** Customize business logic for any supported object and method.
31-
* **[Background Processing](https://github.com/holomodular/ServiceBricks-Documentation/blob/main/V1/BackgroundTasks.md):** Supports asynchronous processes, tasks, and rules.
32-
* **[Relational, Document, Cloud and Embedded Database Support](https://github.com/holomodular/ServiceBricks-Documentation/blob/main/V1/SupportedDatabaseEngines.md):** Works standard with Azure Data Tables, Cosmos DB, InMemory, MongoDB, Postgres, SQLite, SQL Server and more.
33-
* **[Service Bus Engine](https://github.com/holomodular/ServiceBricks-Documentation/blob/main/V1/BroadcastsAndServiceBus.md):** Supports broadcasts of system data with InMemory and Azure Service Bus.
34-
* **[Classic or Modern REST API Design](https://github.com/holomodular/ServiceBricks-Documentation/blob/main/V1/ClassicVsModernRestApi.md):** Choose between Classic or Modern modes, with various response formats.
35-
* **[NuGet Packages](https://github.com/holomodular/ServiceBricks-Documentation/blob/main/V1/NuGet.md):** Quickly build new services and applications.
36-
* **Testing Framework:** Comprehensive Xunit test framework for robust unit and integration testing with thousands of tests available.
37-
* **Open Source:** All referenced assemblies are open source and licensed under MIT or an equivalent license.
26+
Add ServiceBricks:Notification:SendGrid:ApiKey to your appsettings.config
27+
```csharp
28+
using ServiceBricks.Notification.SendGrid;
29+
services.AddServiceBricksNotificationSendGrid();
30+
```
3831

32+
* SMTP - Included in ServiceBricks.Notification
3933

40-
## Getting Started with Examples
34+
See config below
35+
```csharp
36+
services.AddScoped<IEmailProvider, SmtpEmailProvider>();
37+
```
4138

42-
Explore our [ServiceBricks-Examples](https://github.com/holomodular/ServiceBricks-Examples) repository for practical examples on hosting and deploying your ServiceBricks foundation. From single, monolithic web applications to distributed, multi-deployment, containerized web applications, these examples provide the building blocks to create and scale your own foundations quickly.
39+
#### SMS
4340

44-
## Documentation
41+
Coming soon! Or build your own as needed.
4542

46-
Check out our [ServiceBricks-Documentation](https://github.com/holomodular/ServiceBricks-Documentation) repository for comprehensive documentation on the platform, including guides on using all components and developing your own microservices.
43+
## Data Transfer Objects
4744

48-
## Official Pre-Built Microservices
45+
### NotifyMessageDto - Admin Policy
46+
Used to store a notification message. It additionally contains properties to support the IDpWorkProcess and WorkService for processing the table like a work queue.
4947

50-
Get started quickly with our pre-built microservices:
48+
```csharp
5149

52-
* [ServiceBricks-Cache](https://github.com/holomodular/ServiceBricks-Cache): Generic data storage microservice with a built in expiration process and a distributed semaphore for cache-level locking for multi-instance deployments.
53-
* [ServiceBricks-Logging](https://github.com/holomodular/ServiceBricks-Logging): Service-scoped or centralized logging and a web request auditing microservice.
54-
* [ServiceBricks-Notification](https://github.com/holomodular/ServiceBricks-Notification): Notification and delivery for emails and SMS messages.
55-
* [ServiceBricks-Security](https://github.com/holomodular/ServiceBricks-Security): Authentication, authorization, and application security with JWT bearer token support for multi-instance deployments.
56-
* [ServiceBricks-Work](https://github.com/holomodular/ServiceBricks-Work): Work queue microservice for reliable, event-driven background processing.
50+
public class NotifyMessageDto : DataTransferObject, IDpWorkProcess
51+
{
52+
public string SenderType { get; set; }
53+
public virtual bool IsHtml { get; set; }
54+
public virtual string Priority { get; set; }
55+
public virtual string Subject { get; set; }
56+
public virtual string BccAddress { get; set; }
57+
public virtual string CcAddress { get; set; }
58+
public virtual string ToAddress { get; set; }
59+
public virtual string FromAddress { get; set; }
60+
public virtual string Body { get; set; }
61+
public virtual string BodyHtml { get; set; }
5762

58-
## Trademarks
63+
// IDpWorkProcess related
64+
public bool IsError { get; set; }
65+
public bool IsComplete { get; set; }
66+
public int RetryCount { get; set; }
67+
public DateTimeOffset FutureProcessDate { get; set; }
68+
public DateTimeOffset CreateDate { get; set; }
69+
public DateTimeOffset UpdateDate { get; set; }
70+
public DateTimeOffset ProcessDate { get; set; }
71+
public string ProcessResponse { get; set; }
72+
public bool IsProcessing { get; set; }
5973

60-
“ServiceBricks”, "ServiceQuery" and “HoloModular” are trademarks of HoloModular LLC. The MIT License covers code only; it does not grant rights to use our trademarks, logos, or brand assets (including in modified or redistributed versions) without permission.
74+
}
6175

62-
## About
76+
```
77+
78+
## Business Events and Processes
79+
80+
### SendNotificationProcess
81+
This process is used to send a notify message. The SendNotificationProcessRule class implements the functionality to send an email or sms sendertype.
82+
You can register new rules to handle new sender types or unregister the existing rule and build your own.
83+
84+
85+
## Background Tasks and Timers
86+
87+
### SendNotificationTimer class
88+
A background timer can be enabled, with an initial delay and interval, that executes the SendNotificationTask.
89+
90+
[View Source](https://github.com/holomodular/ServiceBricks-Notification/blob/main/src/V1/ServiceBricks.Notification/Background/SendNotificationTimer.cs)
91+
92+
### SendNotificationTask class
93+
This background task invokes the [NotifyMessageWorkService](https://github.com/holomodular/ServiceBricks-Notification/blob/main/src/V1/ServiceBricks.Notification/Background/SendNotificationTask.cs)
94+
95+
[View Source](https://github.com/holomodular/ServiceBricks-Notification/blob/main/src/V1/ServiceBricks.Notification/Background/SendNotificationTask.cs)
96+
97+
98+
## Service Bus
99+
100+
### CreateApplicationEmailBroadcast
101+
This microservice subscribes to the CreateApplicationEmailBroadcast message.
102+
It is associated to the [CreateApplicationEmailRule](https://github.com/holomodular/ServiceBricks-Notification/blob/main/src/V1/ServiceBricks.Notification/Rule/CreateApplicationEmailRule.cs) Business Rule.
103+
When receiving the message from service bus, it will attempt to send the notification first, then store the process disposition before creating the message in storage. This reduces the reliance on the timer for sending messages and sends messages immediately when received.
104+
105+
```csharp
106+
107+
public class CreateApplicationEmailBroadcast : DomainBroadcast<ApplicationEmailDto>
108+
{
109+
public CreateApplicationEmailBroadcast(ApplicationEmailDto obj)
110+
{
111+
DomainObject = obj;
112+
}
113+
}
114+
115+
```
116+
117+
### CreateApplicationSmsBroadcast
118+
This microservice subscribes to the CreateApplicationSmsBroadcast message.
119+
It is associated to the [CreateApplicationSmsRule](https://github.com/holomodular/ServiceBricks-Notification/blob/main/src/V1/ServiceBricks.Notification/Rule/CreateApplicationSmsRule.cs) Business Rule.
120+
When receiving the message from service bus, it will attempt to send the notification first, then store the process disposition before creating the message in storage. This reduces the reliance on the timer for sending messages and sends messages immediately when received.
121+
```csharp
122+
123+
public class CreateApplicationSmsBroadcast : DomainBroadcast<ApplicationSmsDto>
124+
{
125+
public CreateApplicationSmsBroadcast(ApplicationSmsDto obj)
126+
{
127+
DomainObject = obj;
128+
}
129+
}
130+
131+
```
132+
133+
## Additional
134+
135+
136+
## Application Settings
137+
138+
```json
139+
140+
{
141+
// ServiceBricks Settings
142+
"ServiceBricks":{
143+
144+
// Notification Microservice Settings
145+
"Notification": {
146+
147+
// Send Notification Process
148+
"Send": {
149+
"TimerEnabled": false,
150+
"TimerIntervalMilliseconds": 7000,
151+
"TimerDueMilliseconds": 1000,
152+
"EmailFromDefault": "support@servicebricks.com",
153+
"SmsFromDefault": "1234567890",
154+
"IsDevelopment": false,
155+
"DevelopmentEmailTo": "developer@servicebricks.com",
156+
"DevelopmentSmsTo": "1234567890"
157+
},
158+
159+
// SMTP provider
160+
"Smtp": {
161+
"EmailServer": "yourserver.com",
162+
"EmailPort": 123,
163+
"EmailEnableSsl": true,
164+
"EmailUsername": "username",
165+
"EmailPassword": "password"
166+
},
167+
168+
// ServiceBricks.Notification.SendGrid NuGet Package
169+
"SendGrid": {
170+
"ApiKey": "SendGridApiKey"
171+
}
172+
}
173+
}
174+
}
175+
176+
```
177+
178+
# About ServiceBricks
179+
180+
ServiceBricks is the cornerstone for building a microservices foundation.
181+
Visit https://ServiceBricks.com to learn more.
63182

64-
ServiceBricks is owned and maintained by HoloModular LLC and authored by Danny Logsdon (Founder). Visit our websites at https://HoloModular.com, https://ServiceBricks.com or https://www.linkedin.com/in/danlogsdon to learn more.

src/V1/ServiceBricks.Notification.AzureDataTables/ServiceBricks.Notification.AzureDataTables.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<Version>1.4.0-e</Version>
4+
<Version>1.4.0</Version>
55
<Description>The open source microservices platform. Visit https://ServiceBricks.com to learn more.</Description>
66
<PackageId>ServiceBricks.Notification.AzureDataTables</PackageId>
77
<Title>ServiceBricks.Notification.AzureDataTables</Title>
@@ -36,6 +36,6 @@
3636
<ProjectReference Include="..\ServiceBricks.Notification\ServiceBricks.Notification.csproj" />
3737
</ItemGroup>
3838
<ItemGroup>
39-
<PackageReference Include="ServiceBricks.Core" Version="1.4.0-e" />
39+
<PackageReference Include="ServiceBricks.Core" Version="1.4.0" />
4040
</ItemGroup>
4141
</Project>

0 commit comments

Comments
 (0)