You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the first in a series of blog posts that go into detail about a number of [open source](/opensource) projects I have released, starting with [spt-development-cid](https://github.com/spt-development/spt-development-cid). `spt-development-cid` is a very simple library that utilises `ThreadLocal` for tracking a correlation ID similar to that described by Sam Newman, in Chapter 8 of his excellent book [Building Microservices](https://www.amazon.co.uk/Building-Microservices-Sam-Newman/dp/1491950358){:target="_blank"}. If you have ever tried to support a system consisting of multiple services that *doesn't* use correlation IDs, then you will understand their importance! Sam's book describes the concept better than I would, so I urge you to read that if you require a deeper understanding.
10
+
This is the first in a series of blog posts that go into detail about a number of [open source](/opensource) projects we have released, starting with [spt-development-cid](https://github.com/spt-development/spt-development-cid). `spt-development-cid` is a very simple library that utilises `ThreadLocal` for tracking a correlation ID similar to that described by Sam Newman, in Chapter 8 of his excellent book [Building Microservices](https://www.amazon.co.uk/Building-Microservices-Sam-Newman/dp/1491950358){:target="_blank"}. If you have ever tried to support a system consisting of multiple services that *doesn't* use correlation IDs, then you will understand their importance! Sam's book describes the concept better than I would, so I urge you to read that if you require a deeper understanding.
11
11
{: class="lead"}
12
12
13
-
The code in this library is not complicated and nothing that the average reader wouldn't be able to write themselves, however it is code that I have ended up copy/pasting on multiple projects and serves as the initial building block for the other projects I have open sourced.
13
+
The code in this library is not complicated and nothing that the average reader wouldn't be able to write themselves, however it is code that we have ended up copy/pasting on multiple projects and serves as the initial building block for the other projects we have open sourced.
14
14
15
15
The project is available in [Maven Central](https://mvnrepository.com/artifact/com.spt-development/spt-development-cid), so to use, add it as a dependency to your project,
16
16
@@ -20,4 +20,4 @@ Then inititialise with the `set` method and call `get` to include the correlatio
20
20
21
21
{% gist 7bfcd2c16ea135706731e68df25c9217 %}
22
22
23
-
You are most likely to call `CorrelationId.set()` when you receive a new REST API request or process a new JMS message, as such I have open sourced projects for integrating `spt-development-cid` into a [web project](https://github.com/spt-development/spt-development-cid-web) and a [Spring JMS (listener)](https://github.com/spt-development/spt-development-cid-jms-spring) project.
23
+
You are most likely to call `CorrelationId.set()` when you receive a new REST API request or process a new JMS message, as such we have open sourced projects for integrating `spt-development-cid` into a [web project](https://github.com/spt-development/spt-development-cid-web) and a [Spring JMS (listener)](https://github.com/spt-development/spt-development-cid-jms-spring) project.
Copy file name to clipboardExpand all lines: _posts/2021-09-10-spt-development-release.markdown
+4-4
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,8 @@ date: 2021-09-10 19:55:12 +0000
5
5
author: Simon Taylor
6
6
categories: microservices correlation spring opensource
7
7
---
8
-
I'm pleased to announced that I have now released new and up to date versions of all of the spt-development-* projects related to correlation IDs, logging and
9
-
auditing. The main change to all of the projects is to support JDK8+ and Spring Boot 2.5.4. I will endeavor to release new versions of the libraries, soon after
8
+
I'm pleased to announced that we have now released new and up to date versions of all of the spt-development-* projects related to correlation IDs, logging and
9
+
auditing. The main change to all of the projects is to support JDK8+ and Spring Boot 2.5.4. We will endeavor to release new versions of the libraries, soon after
10
10
each new release of Spring Boot, moving forward. As always, the source is available on [GitHub](https://github.com/spt-development) where there are more detailed
11
11
release notes and the artifacts are also available in [Maven Central](https://mvnrepository.com/artifact/com.spt-development) for easy inclusion in your own
12
12
<em>Java</em> projects.
@@ -25,9 +25,9 @@ The following projects have all been updated to v2.0.0:
I have also created a new [demo project](https://github.com/spt-development/spt-development-demo) that demonstrates how to easily integrate all of the
28
+
We have also created a new [demo project](https://github.com/spt-development/spt-development-demo) that demonstrates how to easily integrate all of the
29
29
spt-development-* projects into a Spring Boot application and the features they provide. I hope to blog in more detail on this in the coming weeks and months.
30
30
31
31
---
32
32
33
-
I hope this helps the community, and if there are any questions or comments, don't hesitate to get in touch.
33
+
We hope this helps the community, and if there are any questions or comments, don't hesitate to get in touch.
I have also upgraded the [demo project](https://github.com/spt-development/spt-development-demo) to Spring Boot 2.5.5 and v2.0.1 of all the libraries above.
26
+
We have also upgraded the [demo project](https://github.com/spt-development/spt-development-demo) to Spring Boot 2.5.5 and v2.0.1 of all the libraries above.
27
27
Additionally, as Spring Boot 2.5.5 adds support for JDK 17, the demo project has also been upgraded to JDK 17.
28
28
29
29
---
30
30
31
-
I hope this helps the community, and if there are any questions or comments, don't hesitate to get in touch.
31
+
We hope this helps the community, and if there are any questions or comments, don't hesitate to get in touch.
Copy file name to clipboardExpand all lines: _posts/2021-10-03-spt-development-audit-spring.markdown
+2-2
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ See the [README](https://github.com/spt-development/spt-development-demo/blob/ma
19
19
20
20
## Auditing
21
21
22
-
There are many reasons why you might want to add auditing to your application. The main reason I wanted to add auditing to [SPT Contractors](https://spt.contractors/) was to be able to trace through how records reached a particular state; having this information has been invaluable on past projects for replaying when things go wrong and answering user queries when records are in a state they don't expect. I wanted an auditing solution that was simple to implement without polluting my business logic with calls to persist the audit records. Additionally, I wanted another service to be responsible for persisting the audit records which could potentially be extended to perform analysis or transformations at a later date. Out of these requirements `spt-development-audit-spring` was born.
22
+
There are many reasons why you might want to add auditing to your application. The main reason we wanted to add auditing to [SPT Contractors](https://spt.contractors/) was to be able to trace through how records reached a particular state; having this information has been invaluable on past projects for replaying when things go wrong and answering user queries when records are in a state they don't expect. We wanted an auditing solution that was simple to implement without polluting my business logic with calls to persist the audit records. Additionally, we wanted another service to be responsible for persisting the audit records which could potentially be extended to perform analysis or transformations at a later date. Out of these requirements `spt-development-audit-spring` was born.
23
23
24
24
## spt-development-audit-spring
25
25
@@ -47,7 +47,7 @@ Multiple parameters can be annotated with `@Audited.Detail` but if you do, the `
47
47
48
48
{% gist 99f18eb85d52dc9acdab8ed87dc6d35c %}
49
49
50
-
The `spt-development-audit-spring-boot-starter` configures the `Slf4jAuditEventWriter` bean by default, which is an instance of the `AuditEventWriter` interface. In a production service you probably want your adit event records persisted to some kind of database, in which case you will need to create a bean that is an instance of `AuditEventWriter` or if your service methods are transactional, an instance of `TransactionAwareAuditEventWriter` so that the audit events are only written if the transaction is successfully committed. For SPT Contractors, I developed a separate service responsible for persisting the audit event records read from a JMS queue and would recommend this approach in general. Creating a `JmsTemplate` bean and setting the `spt.audit.jms.destination` property results in the `spt-development-audit-spring-boot-starter` instantiating a `JmsAuditEventWriter` bean which writes the audit event records to the configured JMS queue, rather than to the logs with `Slf4jAuditEventWriter`. The demo project uses an in-memory Artemis JMS queue to demonstrate this.
50
+
The `spt-development-audit-spring-boot-starter` configures the `Slf4jAuditEventWriter` bean by default, which is an instance of the `AuditEventWriter` interface. In a production service you probably want your adit event records persisted to some kind of database, in which case you will need to create a bean that is an instance of `AuditEventWriter` or if your service methods are transactional, an instance of `TransactionAwareAuditEventWriter` so that the audit events are only written if the transaction is successfully committed. For SPT Contractors, we developed a separate service responsible for persisting the audit event records read from a JMS queue and would recommend this approach in general. Creating a `JmsTemplate` bean and setting the `spt.audit.jms.destination` property results in the `spt-development-audit-spring-boot-starter` instantiating a `JmsAuditEventWriter` bean which writes the audit event records to the configured JMS queue, rather than to the logs with `Slf4jAuditEventWriter`. The demo project uses an in-memory Artemis JMS queue to demonstrate this.
I have also upgraded the [demo project](https://github.com/spt-development/spt-development-demo) to Spring Boot 2.5.6 and v2.0.2 of all the libraries above.
25
+
We have also upgraded the [demo project](https://github.com/spt-development/spt-development-demo) to Spring Boot 2.5.6 and v2.0.2 of all the libraries above.
26
26
27
27
---
28
28
29
-
I hope this helps the community, and if there are any questions or comments, don't hesitate to get in touch.
29
+
We hope this helps the community, and if there are any questions or comments, don't hesitate to get in touch.
I have also upgraded the [demo project](https://github.com/spt-development/spt-development-demo) to Spring Boot 2.6.6 and v2.0.3 of all the libraries above.
27
+
We have also upgraded the [demo project](https://github.com/spt-development/spt-development-demo) to Spring Boot 2.6.6 and v2.0.3 of all the libraries above.
28
28
29
29
---
30
30
31
-
I hope this helps the community, and if there are any questions or comments, don't hesitate to get in touch.
31
+
We hope this helps the community, and if there are any questions or comments, don't hesitate to get in touch.
I have also upgraded the [demo project](https://github.com/spt-development/spt-development-demo) to Spring Boot 2.6.7 and v2.0.4 of all the libraries above.
27
+
We have also upgraded the [demo project](https://github.com/spt-development/spt-development-demo) to Spring Boot 2.6.7 and v2.0.4 of all the libraries above.
28
28
29
29
---
30
30
31
-
I hope this helps the community, and if there are any questions or comments, don't hesitate to get in touch.
31
+
We hope this helps the community, and if there are any questions or comments, don't hesitate to get in touch.
0 commit comments