Skip to content

Commit aa71ac9

Browse files
committed
Move Blaze-Domain, Blaze-Expression, Blaze-Actor and Blaze-Job to separate projects
1 parent 2c751d8 commit aa71ac9

631 files changed

Lines changed: 6837 additions & 31240 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis-deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if [ "$TRAVIS_REPO_SLUG" == "Blazebit/blaze-notify" ] &&
55
[ "$TRAVIS_PULL_REQUEST" == "false" ]; then
66

77
echo "Starting snapshot deployment..."
8-
#mvn -s .travis-settings.xml -DperformRelease -DskipTests -Dgpg.skip=true -Dquiet=true deploy
8+
mvn -B -P blazebit-release -s .travis-settings.xml -DperformRelease -DskipTests -Dgpg.skip=true -Dquiet=true clean deploy
99
echo "Snapshots deployed!"
1010

1111
else

README.md

Lines changed: 288 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ Blaze-Notify is a toolkit that can be used to implement notification processing
1212
What is it?
1313
===========
1414

15-
Blaze-Notify provides an abstraction for notification processing as well as different implementations
15+
Blaze-Notify provides an abstraction for notification processing as well as a memory and a JPA base implementation
1616
that can be integrated into existing applications.
1717

1818
It allows to create templated notification campaigns that can be scheduled and sent to various channels.
19-
The Blaze-Persistence integration makes it possible to efficiently implement recipient selection.
19+
The Blaze-Expression integration makes it possible to efficiently implement recipient selection.
2020

2121
Features
2222
==============
@@ -41,6 +41,8 @@ Blaze-Notify is split up into different modules. We recommend that you define a
4141
```xml
4242
<properties>
4343
<blaze-notify.version>1.0.0-SNAPSHOT</blaze-notify.version>
44+
<blaze-expression.version>1.0.0-Alpha1</blaze-expression.version>
45+
<blaze-job.version>1.0.0-Alpha1</blaze-job.version>
4446
</properties>
4547
```
4648

@@ -58,4 +60,287 @@ Alternatively you can also use our BOM in the `dependencyManagement` section.
5860
</dependency>
5961
</dependencies>
6062
</dependencyManagement>
61-
```
63+
```
64+
65+
## Dependencies setup
66+
67+
For compiling you will only need API artifacts and for the runtime you need impl and integration artifacts.
68+
69+
Blaze-Notify Core module dependencies
70+
71+
```xml
72+
<dependency>
73+
<groupId>com.blazebit</groupId>
74+
<artifactId>blaze-notify-core-api</artifactId>
75+
<version>${blaze-notify.version}</version>
76+
<scope>compile</scope>
77+
</dependency>
78+
<dependency>
79+
<groupId>com.blazebit</groupId>
80+
<artifactId>blaze-notify-core-impl</artifactId>
81+
<version>${blaze-notify.version}</version>
82+
<scope>runtime</scope>
83+
</dependency>
84+
```
85+
86+
Blaze-Notify JPA module dependencies for production workload
87+
88+
```xml
89+
<dependency>
90+
<groupId>com.blazebit</groupId>
91+
<artifactId>blaze-notify-jpa-model-base</artifactId>
92+
<version>${blaze-notify.version}</version>
93+
<scope>compile</scope>
94+
</dependency>
95+
<dependency>
96+
<groupId>com.blazebit</groupId>
97+
<artifactId>blaze-notify-jpa-storage</artifactId>
98+
<version>${blaze-notify.version}</version>
99+
<scope>runtime</scope>
100+
</dependency>
101+
```
102+
103+
Blaze-Notify JPA module Blaze-Expression integration dependencies
104+
105+
```xml
106+
<dependency>
107+
<groupId>com.blazebit</groupId>
108+
<artifactId>blaze-notify-jpa-model-expression</artifactId>
109+
<version>${blaze-notify.version}</version>
110+
<scope>compile</scope>
111+
</dependency>
112+
<dependency>
113+
<groupId>com.blazebit</groupId>
114+
<artifactId>blaze-notify-recipient-resolver-expression</artifactId>
115+
<version>${blaze-notify.version}</version>
116+
<scope>compile</scope>
117+
</dependency>
118+
<dependency>
119+
<groupId>${project.groupId}</groupId>
120+
<artifactId>blaze-expression-persistence</artifactId>
121+
<version>${blaze-expression.version}</version>
122+
</dependency>
123+
```
124+
125+
Blaze-Notify Memory module dependencies for in-memory tests
126+
127+
```xml
128+
<dependency>
129+
<groupId>com.blazebit</groupId>
130+
<artifactId>blaze-notify-memory-model</artifactId>
131+
<version>${blaze-notify.version}</version>
132+
<scope>compile</scope>
133+
</dependency>
134+
<dependency>
135+
<groupId>com.blazebit</groupId>
136+
<artifactId>blaze-notify-memory-storage</artifactId>
137+
<version>${blaze-notify.version}</version>
138+
<scope>runtime</scope>
139+
</dependency>
140+
```
141+
142+
Blaze-Actor scheduler implementation for Blaze-Notify. Use either of the two, the Spring module if you are on Spring
143+
144+
```xml
145+
<dependency>
146+
<groupId>com.blazebit</groupId>
147+
<artifactId>blaze-actor-scheduler-executor</artifactId>
148+
<version>${blaze-actor.version}</version>
149+
<scope>compile</scope>
150+
</dependency>
151+
<dependency>
152+
<groupId>com.blazebit</groupId>
153+
<artifactId>blaze-actor-scheduler-spring</artifactId>
154+
<version>${blaze-actor.version}</version>
155+
<scope>compile</scope>
156+
</dependency>
157+
```
158+
159+
Blaze-Job Schedule support for Blaze-Notify. Use either of the two, the Spring module if you are on Spring
160+
161+
```xml
162+
<dependency>
163+
<groupId>com.blazebit</groupId>
164+
<artifactId>blaze-job-schedule-cron</artifactId>
165+
<version>${blaze-job.version}</version>
166+
<scope>runtime</scope>
167+
</dependency>
168+
<dependency>
169+
<groupId>com.blazebit</groupId>
170+
<artifactId>blaze-job-schedule-spring</artifactId>
171+
<version>${blaze-job.version}</version>
172+
<scope>runtime</scope>
173+
</dependency>
174+
```
175+
176+
Blaze-Job Transaction support for Blaze-Notify. Use either of the three, depending on the transaction API of the target environment
177+
178+
```xml
179+
<dependency>
180+
<groupId>com.blazebit</groupId>
181+
<artifactId>blaze-job-transaction-jpa</artifactId>
182+
<version>${blaze-job.version}</version>
183+
<scope>runtime</scope>
184+
</dependency>
185+
<dependency>
186+
<groupId>com.blazebit</groupId>
187+
<artifactId>blaze-job-transaction-jta</artifactId>
188+
<version>${blaze-job.version}</version>
189+
<scope>runtime</scope>
190+
</dependency>
191+
<dependency>
192+
<groupId>com.blazebit</groupId>
193+
<artifactId>blaze-job-transaction-spring</artifactId>
194+
<version>${blaze-job.version}</version>
195+
<scope>runtime</scope>
196+
</dependency>
197+
```
198+
199+
Blaze-Notify Template support
200+
201+
```xml
202+
<dependency>
203+
<groupId>com.blazebit</groupId>
204+
<artifactId>blaze-notify-template-api</artifactId>
205+
<version>${blaze-notify.version}</version>
206+
<scope>compile</scope>
207+
</dependency>
208+
<dependency>
209+
<groupId>com.blazebit</groupId>
210+
<artifactId>blaze-notify-template-freemarker</artifactId>
211+
<version>${blaze-notify.version}</version>
212+
<scope>compile</scope>
213+
</dependency>
214+
```
215+
216+
Blaze-Notify Processor base implementations
217+
218+
```xml
219+
<dependency>
220+
<groupId>com.blazebit</groupId>
221+
<artifactId>blaze-notify-processor-hibernate-insert-select</artifactId>
222+
<version>${blaze-notify.version}</version>
223+
<scope>compile</scope>
224+
</dependency>
225+
<dependency>
226+
<groupId>com.blazebit</groupId>
227+
<artifactId>blaze-notify-processor-memory</artifactId>
228+
<version>${blaze-notify.version}</version>
229+
<scope>compile</scope>
230+
</dependency>
231+
```
232+
233+
Channels
234+
=========
235+
236+
Blaze-Notify has a SPI for custom channels but offers quite a few channels out of the box
237+
238+
Blaze-Notify SMTP channel
239+
240+
```xml
241+
<dependency>
242+
<groupId>com.blazebit</groupId>
243+
<artifactId>blaze-notify-channel-smtp</artifactId>
244+
<version>${blaze-notify.version}</version>
245+
<scope>compile</scope>
246+
</dependency>
247+
```
248+
249+
Blaze-Notify Slack channel
250+
251+
```xml
252+
<dependency>
253+
<groupId>com.blazebit</groupId>
254+
<artifactId>blaze-notify-channel-slack</artifactId>
255+
<version>${blaze-notify.version}</version>
256+
<scope>compile</scope>
257+
</dependency>
258+
```
259+
260+
Blaze-Notify Memory channel
261+
262+
```xml
263+
<dependency>
264+
<groupId>com.blazebit</groupId>
265+
<artifactId>blaze-notify-channel-memory</artifactId>
266+
<version>${blaze-notify.version}</version>
267+
<scope>compile</scope>
268+
</dependency>
269+
```
270+
271+
E-Mail base model
272+
===========
273+
274+
Blaze-Notify provides a JPA model that can be used as a basis for implementing E-Mail notifications with bounce detection.
275+
276+
```xml
277+
<dependency>
278+
<groupId>com.blazebit</groupId>
279+
<artifactId>blaze-notify-email-model</artifactId>
280+
<version>${blaze-notify.version}</version>
281+
<scope>compile</scope>
282+
</dependency>
283+
<!-- Can be used to handle E-Mail bounces published to AWS SQS via AWS SNS -->
284+
<dependency>
285+
<groupId>com.blazebit</groupId>
286+
<artifactId>blaze-notify-email-sns-sqs-feedback</artifactId>
287+
<version>${blaze-notify.version}</version>
288+
<scope>compile</scope>
289+
</dependency>
290+
```
291+
292+
Documentation
293+
=========
294+
295+
Currently there is no documentation other than the Javadoc.
296+
297+
Quick-start
298+
=================
299+
300+
Working with Blaze-Notify is as simple as persisting jobs that are processed, but first one needs to start a notification job context.
301+
302+
```java
303+
NotificationJobContext jobContext = NotificationJobContext.builder()
304+
.withService(EntityManager.class, entityManager)
305+
.withService(TemplateContext.class, TemplateContext.builder().createContext())
306+
.withProperty(ExecutorServiceScheduler.EXECUTOR_SERVICE_PROPERTY, Executors.newScheduledThreadPool(2))
307+
// No need for trigger based jobs in this example
308+
.withJobProcessorFactory(NotificationJobProcessorFactory.of((context, jobTrigger) -> null))
309+
.withJobInstanceProcessorFactory(NotificationJobInstanceProcessorFactory.of((context, jobInstance) -> EmailNotificationJobInstanceProcessor.INSTANCE))
310+
// Only necessary for notification producing jobs
311+
.withRecipientResolver(NotificationRecipientResolver.of())
312+
.withProperty(SmtpChannel.SMTP_HOST_PROPERTY, "192.168.99.100")
313+
.withProperty(SmtpChannel.SMTP_PORT_PROPERTY, 25)
314+
.withProperty(SmtpChannel.SMTP_USER_PROPERTY, "test")
315+
.withProperty(SmtpChannel.SMTP_PASSWORD_PROPERTY, "test")
316+
.createContext();
317+
```
318+
319+
With that in place, we can create a notification job.
320+
321+
```java
322+
FromEmail from = entityManager.createQuery("SELECT e FROM FromEmail e WHERE e.email = 'no-reply@blazebit.com'", FromEmail.class)
323+
.setMaxResults(1)
324+
.getSingleResult();
325+
EmailNotification emailNotification = new EmailNotification();
326+
emailNotification.setTo("test@blazebit.com");
327+
emailNotification.setChannelType("smtp");
328+
emailNotification.setFrom(from);
329+
emailNotification.setSubject("Hello");
330+
emailNotification.setBodyText("Hey my friend!");
331+
emailNotification.setScheduleTime(Instant.now());
332+
jobContext.getJobManager().addJobInstance(emailNotification);
333+
```
334+
335+
The job is scheduled, executed and then marked as done.
336+
337+
Licensing
338+
=========
339+
340+
This distribution, as a whole, is licensed under the terms of the Apache
341+
License, Version 2.0 (see LICENSE.txt).
342+
343+
References
344+
==========
345+
346+
Project Site: https://notify.blazebit.com (coming at some point)

actor/api/pom.xml

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)