Skip to content

Commit 487ba74

Browse files
Merge pull request #10 from dd4t/release/2.5
Release/2.5
2 parents d1b7882 + f323a85 commit 487ba74

File tree

8 files changed

+62
-44
lines changed

8 files changed

+62
-44
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
[![AppVeyor](https://ci.appveyor.com/api/projects/status/github/dd4t/DD4T.Caching.ApacheMQ?branch=master&svg=true&passingText=master)](https://ci.appveyor.com/project/DD4T/dd4t-caching-apachemq)
22

33
[![AppVeyor](https://ci.appveyor.com/api/projects/status/github/dd4t/DD4T.Caching.ApacheMQ?branch=develop&svg=true&passingText=develop)](https://ci.appveyor.com/project/DD4T/dd4t-caching-apachemq)
4-
# DD4T Essentials
5-
DD4T - delivery framework for Microsoft.NET
4+
# DD4T.Caching.ApacheMQ
5+
Invalidation of items in the cache when Tridion pages or DCPs are republished or unpublished. Uses the Apache ActiveMQ messaging system.
66

7-
DD4T Essentials contains a set of optional extensions that can be used on top of the framework.
7+
## Release notes for version 2.5
8+
9+
- Supports Tridion 9 and higher, as well as older versions (6)
10+
- Upgraded Newtonsoft.Json to 11.0.2

appveyor.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 2.3.0
1+
version: 2.5
22
pull_requests:
33
do_not_increment_build_number: true
44
branches:
@@ -27,6 +27,8 @@ notifications:
2727
auth_token:
2828
secure: sPqYbVki+502+OjRT+o3eITyiG8UDZ0Fu4M1fejZxs3O6OKtYu9JCNS9Ssw3/XjL
2929
channel: '#development'
30+
skip_commits:
31+
message: /\[nobuild\]/
3032
deploy:
3133
- provider: NuGet
3234
api_key:

configuration/DD4T.Caching.ApacheMQ.nuspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
</releaseNotes>
1212
<tags>SDLTridion Tridion SDL SDLWeb DD4T DD4T2 Caching JMS ApacheMQ</tags>
1313
<dependencies>
14-
<dependency id="DD4T.Core" version="2.2.9" />
14+
<dependency id="DD4T.Core" version="2.5" />
1515
<dependency id="Apache.NMS" version="1.7.1" />
1616
<dependency id="Apache.NMS.ActiveMQ" version="1.7.2" />
17+
<dependency id="Newtonsoft.Json" version="11.0.2" />
1718
</dependencies>
1819
</metadata>
1920
</package>

source/DD4T.Caching.ApacheMQ/DD4T.Caching.ApacheMQ.csproj

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>DD4T.Caching.ApacheMQ</RootNamespace>
1111
<AssemblyName>DD4T.Caching.ApacheMQ</AssemblyName>
12-
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
12+
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
<TargetFrameworkProfile />
1515
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
@@ -35,47 +35,36 @@
3535
<ItemGroup>
3636
<Reference Include="Apache.NMS, Version=1.7.1.3894, Culture=neutral, PublicKeyToken=82756feee3957618, processorArchitecture=MSIL">
3737
<HintPath>..\packages\Apache.NMS.1.7.1\lib\net40\Apache.NMS.dll</HintPath>
38-
<Private>False</Private>
3938
</Reference>
4039
<Reference Include="Apache.NMS.ActiveMQ, Version=1.7.2.4108, Culture=neutral, PublicKeyToken=82756feee3957618, processorArchitecture=MSIL">
4140
<HintPath>..\packages\Apache.NMS.ActiveMQ.1.7.2\lib\net40\Apache.NMS.ActiveMQ.dll</HintPath>
42-
<Private>False</Private>
4341
</Reference>
44-
<Reference Include="DD4T.ContentModel, Version=2.2.2.0, Culture=neutral, PublicKeyToken=4450e3c7f68bf872, processorArchitecture=MSIL">
45-
<HintPath>..\packages\DD4T.Model.2.2.2\lib\net45\DD4T.ContentModel.dll</HintPath>
46-
<Private>False</Private>
42+
<Reference Include="DD4T.ContentModel, Version=2.5.0.0, Culture=neutral, PublicKeyToken=4450e3c7f68bf872, processorArchitecture=MSIL">
43+
<HintPath>..\packages\DD4T.Model.2.5.0\lib\net45\DD4T.ContentModel.dll</HintPath>
4744
</Reference>
48-
<Reference Include="DD4T.ContentModel.Contracts, Version=2.2.2.0, Culture=neutral, PublicKeyToken=4450e3c7f68bf872, processorArchitecture=MSIL">
49-
<HintPath>..\packages\DD4T.Model.2.2.2\lib\net45\DD4T.ContentModel.Contracts.dll</HintPath>
50-
<Private>False</Private>
45+
<Reference Include="DD4T.ContentModel.Contracts, Version=2.5.0.0, Culture=neutral, PublicKeyToken=4450e3c7f68bf872, processorArchitecture=MSIL">
46+
<HintPath>..\packages\DD4T.Model.2.5.0\lib\net45\DD4T.ContentModel.Contracts.dll</HintPath>
5147
</Reference>
52-
<Reference Include="DD4T.ContentModel.XmlSerializers, Version=2.2.2.0, Culture=neutral, PublicKeyToken=4450e3c7f68bf872, processorArchitecture=MSIL">
53-
<HintPath>..\packages\DD4T.Model.2.2.2\lib\net45\DD4T.ContentModel.XmlSerializers.dll</HintPath>
54-
<Private>False</Private>
48+
<Reference Include="DD4T.ContentModel.XmlSerializers, Version=2.5.0.0, Culture=neutral, PublicKeyToken=4450e3c7f68bf872, processorArchitecture=MSIL">
49+
<HintPath>..\packages\DD4T.Model.2.5.0\lib\net45\DD4T.ContentModel.XmlSerializers.dll</HintPath>
5550
</Reference>
56-
<Reference Include="DD4T.Core.Contracts, Version=2.2.9.0, Culture=neutral, processorArchitecture=MSIL">
57-
<HintPath>..\packages\DD4T.Core.2.2.9\lib\net45\DD4T.Core.Contracts.dll</HintPath>
58-
<Private>False</Private>
51+
<Reference Include="DD4T.Core.Contracts, Version=2.5.0.0, Culture=neutral, processorArchitecture=MSIL">
52+
<HintPath>..\packages\DD4T.Core.2.5.0\lib\net45\DD4T.Core.Contracts.dll</HintPath>
5953
</Reference>
60-
<Reference Include="DD4T.Factories, Version=2.2.9.0, Culture=neutral, processorArchitecture=MSIL">
61-
<HintPath>..\packages\DD4T.Core.2.2.9\lib\net45\DD4T.Factories.dll</HintPath>
62-
<Private>False</Private>
54+
<Reference Include="DD4T.Factories, Version=2.5.0.0, Culture=neutral, processorArchitecture=MSIL">
55+
<HintPath>..\packages\DD4T.Core.2.5.0\lib\net45\DD4T.Factories.dll</HintPath>
6356
</Reference>
64-
<Reference Include="DD4T.Serialization, Version=2.2.2.0, Culture=neutral, PublicKeyToken=4450e3c7f68bf872, processorArchitecture=MSIL">
65-
<HintPath>..\packages\DD4T.Model.2.2.2\lib\net45\DD4T.Serialization.dll</HintPath>
66-
<Private>False</Private>
57+
<Reference Include="DD4T.Serialization, Version=2.5.0.0, Culture=neutral, PublicKeyToken=4450e3c7f68bf872, processorArchitecture=MSIL">
58+
<HintPath>..\packages\DD4T.Model.2.5.0\lib\net45\DD4T.Serialization.dll</HintPath>
6759
</Reference>
68-
<Reference Include="DD4T.Utils, Version=2.2.9.0, Culture=neutral, processorArchitecture=MSIL">
69-
<HintPath>..\packages\DD4T.Core.2.2.9\lib\net45\DD4T.Utils.dll</HintPath>
70-
<Private>False</Private>
60+
<Reference Include="DD4T.Utils, Version=2.5.0.0, Culture=neutral, processorArchitecture=MSIL">
61+
<HintPath>..\packages\DD4T.Core.2.5.0\lib\net45\DD4T.Utils.dll</HintPath>
7162
</Reference>
72-
<Reference Include="DD4T.ViewModels, Version=2.2.9.0, Culture=neutral, processorArchitecture=MSIL">
73-
<HintPath>..\packages\DD4T.Core.2.2.9\lib\net45\DD4T.ViewModels.dll</HintPath>
74-
<Private>False</Private>
63+
<Reference Include="DD4T.ViewModels, Version=2.5.0.0, Culture=neutral, processorArchitecture=MSIL">
64+
<HintPath>..\packages\DD4T.Core.2.5.0\lib\net45\DD4T.ViewModels.dll</HintPath>
7565
</Reference>
76-
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
77-
<HintPath>..\packages\Newtonsoft.Json.10.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
78-
<Private>False</Private>
66+
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
67+
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
7968
</Reference>
8069
<Reference Include="System" />
8170
<Reference Include="System.Core" />
@@ -93,13 +82,12 @@
9382
</ItemGroup>
9483
<ItemGroup>
9584
<None Include="app.config" />
96-
<None Include="packages.config">
97-
<SubType>Designer</SubType>
98-
</None>
85+
<None Include="packages.config" />
9986
</ItemGroup>
10087
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
10188
<Import Project="..\..\DD4T.Essentials.Targets" />
10289
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
90+
<Import Project="$(SolutionDir)\PrivateFalse.targets" Condition="Exists('$(SolutionDir)\PrivateFalse.targets')" />
10391
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
10492
<PropertyGroup>
10593
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>

source/DD4T.Caching.ApacheMQ/JMSMessageProvider.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System;
99
using System.Collections.Generic;
1010
using System.IO;
11+
using System.Text.RegularExpressions;
1112

1213
namespace DD4T.Caching.ApacheMQ
1314
{
@@ -108,6 +109,13 @@ protected void HandleMessage(IMessage receivedMsg)
108109
try
109110
{
110111
ICacheEvent cacheEvent = CacheEventSerializer.Deserialize(message.Text);
112+
// In Tridion 9, the key sometimes changes from the original format:
113+
// 1:123:456 (namespace:pubid:itemid)
114+
// to:
115+
// 1:123:456:PageMeta (namespace:pubid:itemid:class) -- can also be ComponentMeta, BinaryMeta, etc
116+
// we will remove that last bit, because the cacheagent doesn't know about it and won't invalidate
117+
cacheEvent.Key = FixCacheEventKey(cacheEvent.Key);
118+
111119
foreach (IObserver<ICacheEvent> observer in _observers)
112120
{
113121
observer.OnNext(cacheEvent);
@@ -166,6 +174,12 @@ public void Dispose()
166174
}
167175
#endregion
168176

177+
private static Regex reFixCacheEventKey = new Regex("^([0-9]+:[0-9]+:[0-9]+).*$", RegexOptions.Compiled);
178+
179+
private static string FixCacheEventKey(string originalKey)
180+
{
181+
return reFixCacheEventKey.Replace(originalKey, "$1");
182+
}
169183
public class CacheEventSerializer
170184
{
171185
private static JsonSerializer _serializer = null;

source/DD4T.Caching.ApacheMQ/app.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
</dependentAssembly>
2121
</assemblyBinding>
2222
</runtime>
23-
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/></startup></configuration>
23+
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/></startup></configuration>
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Apache.NMS" version="1.7.1" targetFramework="net452" />
4-
<package id="Apache.NMS.ActiveMQ" version="1.7.2" targetFramework="net452" />
5-
<package id="DD4T.Core" version="2.2.9" targetFramework="net452" />
6-
<package id="DD4T.Model" version="2.2.2" targetFramework="net452" />
7-
<package id="Newtonsoft.Json" version="10.0.1" targetFramework="net452" />
3+
<package id="Apache.NMS" version="1.7.1" targetFramework="net451" />
4+
<package id="Apache.NMS.ActiveMQ" version="1.7.2" targetFramework="net451" />
5+
<package id="DD4T.Core" version="2.5.0" targetFramework="net451" />
6+
<package id="DD4T.Model" version="2.5.0" targetFramework="net451" />
7+
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net451" />
88
</packages>

source/PrivateFalse.targets

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
4+
<!-- make all references non-private, so they won't be copied to the output folder -->
5+
<Target Name="ClearReferenceCopyLocalPaths" AfterTargets="ResolveAssemblyReferences">
6+
<ItemGroup>
7+
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" />
8+
</ItemGroup>
9+
</Target>
10+
</Project>

0 commit comments

Comments
 (0)