Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/Kafka/Protobuf/src/Protobuf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<!-- This property makes the build directory similar to a publish directory and helps the AWS .NET Lambda Mock Test Tool find project dependencies. -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<!-- Generate ready to run images during publishing to improve cold start time. -->
<PublishReadyToRun>true</PublishReadyToRun>
<PublishReadyToRun>true</PublishReadyToRun>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Amazon.Lambda.RuntimeSupport" Version="1.12.0" />
Expand All @@ -31,6 +31,7 @@
<GrpcServices>Client</GrpcServices>
<Access>Public</Access>
<ProtoCompile>True</ProtoCompile>

<CompileOutputs>True</CompileOutputs>
<OutputDir>obj\Debug/net8.0/</OutputDir>
<Generator>MSBuild:Compile</Generator>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--suppress MsbuildTargetFrameworkTagInspection -->

<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../KafkaDependencies.props" />

<PropertyGroup>
<PackageId>AWS.Lambda.Powertools.Kafka.Avro</PackageId>
Expand All @@ -12,10 +12,20 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<!-- Release: Use source file inclusion -->
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<IncludeKafkaFiles>true</IncludeKafkaFiles>
<DefineConstants>$(DefineConstants);KAFKA_AVRO</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Apache.Avro"/>
</ItemGroup>
<ItemGroup>

<!-- Debug: Use project references -->
<ItemGroup Condition="'$(Configuration)'=='Debug'">
<ProjectReference Include="..\AWS.Lambda.Powertools.Kafka\AWS.Lambda.Powertools.Kafka.csproj"/>
<ProjectReference Include="..\AWS.Lambda.Powertools.Common\AWS.Lambda.Powertools.Common.csproj"/>
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
/*
* Copyright JsonCons.Net authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Text.Json;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--suppress MsbuildTargetFrameworkTagInspection -->
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="../KafkaDependencies.props" />
<PropertyGroup>
<PackageId>AWS.Lambda.Powertools.Kafka.Json</PackageId>
<Description>Powertools for AWS Lambda (.NET) - Kafka Json consumer package.</Description>
Expand All @@ -10,10 +10,17 @@
<TargetMultiFramework>false</TargetMultiFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\AWS.Lambda.Powertools.Kafka\AWS.Lambda.Powertools.Kafka.csproj" />
</ItemGroup>
<!-- Release: Use source file inclusion -->
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<IncludeKafkaFiles>true</IncludeKafkaFiles>
<DefineConstants>$(DefineConstants);KAFKA_JSON</DefineConstants>
</PropertyGroup>

<!-- Debug: Use project references -->
<ItemGroup Condition="'$(Configuration)'=='Debug'">
<ProjectReference Include="..\AWS.Lambda.Powertools.Kafka\AWS.Lambda.Powertools.Kafka.csproj"/>
<ProjectReference Include="..\AWS.Lambda.Powertools.Common\AWS.Lambda.Powertools.Common.csproj"/>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
/*
* Copyright JsonCons.Net authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

using System.Diagnostics.CodeAnalysis;
using System.Text;
using System.Text.Json;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!--suppress MsbuildTargetFrameworkTagInspection -->

<Project Sdk="Microsoft.NET.Sdk">

<Import Project="../KafkaDependencies.props" />
<PropertyGroup>
<PackageId>AWS.Lambda.Powertools.Kafka.Protobuf</PackageId>
<Description>Powertools for AWS Lambda (.NET) - Kafka Protobuf consumer package.</Description>
Expand All @@ -12,13 +11,21 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<!-- Release: Use source file inclusion -->
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<IncludeKafkaFiles>true</IncludeKafkaFiles>
<DefineConstants>$(DefineConstants);KAFKA_PROTOBUF</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Google.Protobuf" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\AWS.Lambda.Powertools.Kafka\AWS.Lambda.Powertools.Kafka.csproj" />
</ItemGroup>

<!-- Debug: Use project references -->
<ItemGroup Condition="'$(Configuration)'=='Debug'">
<ProjectReference Include="..\AWS.Lambda.Powertools.Kafka\AWS.Lambda.Powertools.Kafka.csproj"/>
<ProjectReference Include="..\AWS.Lambda.Powertools.Common\AWS.Lambda.Powertools.Common.csproj"/>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
/*
* Copyright JsonCons.Net authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Text.Json;
Expand Down
23 changes: 8 additions & 15 deletions libraries/src/AWS.Lambda.Powertools.Kafka/ConsumerRecord.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
/*
* Copyright JsonCons.Net authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

#if KAFKA_JSON
namespace AWS.Lambda.Powertools.Kafka.Json;
#elif KAFKA_AVRO
namespace AWS.Lambda.Powertools.Kafka.Avro;
#elif KAFKA_PROTOBUF
namespace AWS.Lambda.Powertools.Kafka.Protobuf;
#else
namespace AWS.Lambda.Powertools.Kafka;
#endif

/// <summary>
/// Represents a single record consumed from a Kafka topic.
Expand Down
23 changes: 8 additions & 15 deletions libraries/src/AWS.Lambda.Powertools.Kafka/ConsumerRecords.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
/*
* Copyright JsonCons.Net authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

using System.Collections;

#if KAFKA_JSON
namespace AWS.Lambda.Powertools.Kafka.Json;
#elif KAFKA_AVRO
namespace AWS.Lambda.Powertools.Kafka.Avro;
#elif KAFKA_PROTOBUF
namespace AWS.Lambda.Powertools.Kafka.Protobuf;
#else
namespace AWS.Lambda.Powertools.Kafka;
#endif

/// <summary>
/// Represents a collection of Kafka consumer records that can be enumerated.
Expand Down
23 changes: 8 additions & 15 deletions libraries/src/AWS.Lambda.Powertools.Kafka/HeaderExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
/*
* Copyright JsonCons.Net authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

using System.Text;

#if KAFKA_JSON
namespace AWS.Lambda.Powertools.Kafka.Json;
#elif KAFKA_AVRO
namespace AWS.Lambda.Powertools.Kafka.Avro;
#elif KAFKA_PROTOBUF
namespace AWS.Lambda.Powertools.Kafka.Protobuf;
#else
namespace AWS.Lambda.Powertools.Kafka;
#endif

/// <summary>
/// Extension methods for Kafka headers in ConsumerRecord.
Expand Down
15 changes: 0 additions & 15 deletions libraries/src/AWS.Lambda.Powertools.Kafka/InternalsVisibleTo.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
/*
* Copyright JsonCons.Net authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("AWS.Lambda.Powertools.Kafka.Tests")]
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
/*
* Copyright JsonCons.Net authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

using Amazon.Lambda.Core;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
Expand All @@ -23,7 +8,15 @@
using System.Text.Json.Serialization.Metadata;
using AWS.Lambda.Powertools.Common;

#if KAFKA_JSON
namespace AWS.Lambda.Powertools.Kafka.Json;
#elif KAFKA_AVRO
namespace AWS.Lambda.Powertools.Kafka.Avro;
#elif KAFKA_PROTOBUF
namespace AWS.Lambda.Powertools.Kafka.Protobuf;
#else
namespace AWS.Lambda.Powertools.Kafka;
#endif

/// <summary>
/// Base class for Kafka event serializers that provides common functionality
Expand Down
8 changes: 8 additions & 0 deletions libraries/src/AWS.Lambda.Powertools.Kafka/SchemaMetadata.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#if KAFKA_JSON
namespace AWS.Lambda.Powertools.Kafka.Json;
#elif KAFKA_AVRO
namespace AWS.Lambda.Powertools.Kafka.Avro;
#elif KAFKA_PROTOBUF
namespace AWS.Lambda.Powertools.Kafka.Protobuf;
#else
namespace AWS.Lambda.Powertools.Kafka;
#endif

/// <summary>
/// Represents metadata about the schema used for serializing the record's value or key.
Expand Down
20 changes: 20 additions & 0 deletions libraries/src/KafkaDependencies.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project>
<PropertyGroup>
<IncludeKafkaFiles Condition="'$(IncludeKafkaFiles)' == ''">false</IncludeKafkaFiles>
</PropertyGroup>

<!-- Include source files when IncludeKafkaFiles is true -->
<ItemGroup Condition="'$(IncludeKafkaFiles)' == 'true'">
<PackageReference Include="Amazon.Lambda.Core"/>
<PackageReference Include="AspectInjector"/>

<Compile Include="..\AWS.Lambda.Powertools.Kafka\**\*.cs">
<Link>Kafka\%(RecursiveDir)%(Filename)%(Extension)</Link>
</Compile>
<Compile Include="..\AWS.Lambda.Powertools.Common\**\*.cs">
<Link>Common\%(RecursiveDir)%(Filename)%(Extension)</Link>
</Compile>
<Compile Remove="..\AWS.Lambda.Powertools.Kafka\obj\**"/>
<Compile Remove="..\AWS.Lambda.Powertools.Common\obj\**"/>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
/*
* Copyright JsonCons.Net authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

using System.Text;
using Amazon.Lambda.Core;
using Amazon.Lambda.TestUtilities;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
/*
* Copyright JsonCons.Net authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

using System.Runtime.Serialization;
using System.Text;
using AWS.Lambda.Powertools.Kafka.Avro;
Expand Down
Loading
Loading