Skip to content

Commit ab5dd2c

Browse files
lukaszzborekspetz
andauthored
feat(csharp): add consumer and publisher clients (#2259)
- Add IggyPublisher for sending messages: - Create stream and topic - Send direct or in background - Generic version with serializer - Add IggyConsumer for polling messages: - Create and join consumer group - Store offset support - IAsyncEnumerable support - Generic version with deserializer - Add builders for both clients - Implement AES encryptor - Change `Message` from readonly struct to class --------- Co-authored-by: Piotr Gankiewicz <[email protected]>
1 parent 3ab721d commit ab5dd2c

File tree

107 files changed

+6675
-1906
lines changed

Some content is hidden

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

107 files changed

+6675
-1906
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ foreign/node/**/node_modules
2525
foreign/node/**/dist
2626
foreign/node/npm-debug.log*
2727
foreign/node/.npm
28-
foreign/csharp/**/*.DotSettings.user
28+
/**/*.DotSettings.user
2929
*.exe
3030
*.exe~
3131
*.dll

examples/csharp/.editorconfig

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
[*]
2+
charset = utf-8
3+
end_of_line = crlf
4+
trim_trailing_whitespace = false
5+
insert_final_newline = true
6+
indent_style = space
7+
indent_size = 4
8+
9+
# Microsoft .NET properties
10+
csharp_preferred_modifier_order = public, private, protected, internal, file, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async, required:suggestion
11+
csharp_style_prefer_utf8_string_literals = true:suggestion
12+
csharp_style_var_for_built_in_types = true:suggestion
13+
dotnet_naming_rule.constants_rule.import_to_resharper = True
14+
dotnet_naming_rule.constants_rule.resharper_description = Constant fields (not private)
15+
dotnet_naming_rule.constants_rule.resharper_guid = 669e5282-fb4b-4e90-91e7-07d269d04b60
16+
dotnet_naming_rule.constants_rule.severity = warning
17+
dotnet_naming_rule.constants_rule.style = all_upper_style
18+
dotnet_naming_rule.constants_rule.symbols = constants_symbols
19+
dotnet_naming_rule.interfaces_rule.import_to_resharper = True
20+
dotnet_naming_rule.interfaces_rule.resharper_description = Interfaces
21+
dotnet_naming_rule.interfaces_rule.resharper_guid = a7a3339e-4e89-4319-9735-a9dc4cb74cc7
22+
dotnet_naming_rule.interfaces_rule.severity = warning
23+
dotnet_naming_rule.interfaces_rule.style = i_upper_camel_case_style
24+
dotnet_naming_rule.interfaces_rule.symbols = interfaces_symbols
25+
dotnet_naming_rule.unity_serialized_field_rule.import_to_resharper = True
26+
dotnet_naming_rule.unity_serialized_field_rule.resharper_description = Unity serialized field
27+
dotnet_naming_rule.unity_serialized_field_rule.resharper_guid = 5f0fdb63-c892-4d2c-9324-15c80b22a7ef
28+
dotnet_naming_rule.unity_serialized_field_rule.severity = warning
29+
dotnet_naming_rule.unity_serialized_field_rule.style = lower_camel_case_style_1
30+
dotnet_naming_rule.unity_serialized_field_rule.symbols = unity_serialized_field_symbols
31+
dotnet_naming_rule.unity_serialized_field_rule_1.import_to_resharper = True
32+
dotnet_naming_rule.unity_serialized_field_rule_1.resharper_description = Unity serialized field
33+
dotnet_naming_rule.unity_serialized_field_rule_1.resharper_guid = 5f0fdb63-c892-4d2c-9324-15c80b22a7ef
34+
dotnet_naming_rule.unity_serialized_field_rule_1.severity = warning
35+
dotnet_naming_rule.unity_serialized_field_rule_1.style = lower_camel_case_style_1
36+
dotnet_naming_rule.unity_serialized_field_rule_1.symbols = unity_serialized_field_symbols_1
37+
dotnet_naming_rule.unity_serialized_field_rule_2.import_to_resharper = True
38+
dotnet_naming_rule.unity_serialized_field_rule_2.resharper_description = Unity serialized field
39+
dotnet_naming_rule.unity_serialized_field_rule_2.resharper_guid = 5f0fdb63-c892-4d2c-9324-15c80b22a7ef
40+
dotnet_naming_rule.unity_serialized_field_rule_2.severity = warning
41+
dotnet_naming_rule.unity_serialized_field_rule_2.style = lower_camel_case_style_1
42+
dotnet_naming_rule.unity_serialized_field_rule_2.symbols = unity_serialized_field_symbols_2
43+
dotnet_naming_rule.unity_serialized_field_rule_3.import_to_resharper = True
44+
dotnet_naming_rule.unity_serialized_field_rule_3.resharper_description = Unity serialized field
45+
dotnet_naming_rule.unity_serialized_field_rule_3.resharper_guid = 5f0fdb63-c892-4d2c-9324-15c80b22a7ef
46+
dotnet_naming_rule.unity_serialized_field_rule_3.severity = warning
47+
dotnet_naming_rule.unity_serialized_field_rule_3.style = lower_camel_case_style_1
48+
dotnet_naming_rule.unity_serialized_field_rule_3.symbols = unity_serialized_field_symbols_3
49+
dotnet_naming_rule.unity_serialized_field_rule_4.import_to_resharper = True
50+
dotnet_naming_rule.unity_serialized_field_rule_4.resharper_description = Unity serialized field
51+
dotnet_naming_rule.unity_serialized_field_rule_4.resharper_guid = 5f0fdb63-c892-4d2c-9324-15c80b22a7ef
52+
dotnet_naming_rule.unity_serialized_field_rule_4.severity = warning
53+
dotnet_naming_rule.unity_serialized_field_rule_4.style = lower_camel_case_style_1
54+
dotnet_naming_rule.unity_serialized_field_rule_4.symbols = unity_serialized_field_symbols_4
55+
dotnet_naming_style.all_upper_style.capitalization = all_upper
56+
dotnet_naming_style.all_upper_style.word_separator = _
57+
dotnet_naming_style.i_upper_camel_case_style.capitalization = pascal_case
58+
dotnet_naming_style.i_upper_camel_case_style.required_prefix = I
59+
dotnet_naming_style.lower_camel_case_style.capitalization = camel_case
60+
dotnet_naming_style.lower_camel_case_style.required_prefix = _
61+
dotnet_naming_style.lower_camel_case_style_1.capitalization = camel_case
62+
dotnet_naming_style.upper_camel_case_style.capitalization = pascal_case
63+
dotnet_naming_symbols.constants_symbols.applicable_accessibilities = public, internal, protected, protected_internal, private_protected
64+
dotnet_naming_symbols.constants_symbols.applicable_kinds = field
65+
dotnet_naming_symbols.constants_symbols.required_modifiers = const
66+
dotnet_naming_symbols.constants_symbols.resharper_applicable_kinds = constant_field
67+
dotnet_naming_symbols.constants_symbols.resharper_required_modifiers = any
68+
dotnet_naming_symbols.interfaces_symbols.applicable_accessibilities = *
69+
dotnet_naming_symbols.interfaces_symbols.applicable_kinds = interface
70+
dotnet_naming_symbols.interfaces_symbols.resharper_applicable_kinds = interface
71+
dotnet_naming_symbols.interfaces_symbols.resharper_required_modifiers = any
72+
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_accessibilities = *
73+
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_kinds =
74+
dotnet_naming_symbols.unity_serialized_field_symbols.resharper_applicable_kinds = unity_serialised_field
75+
dotnet_naming_symbols.unity_serialized_field_symbols.resharper_required_modifiers = instance
76+
dotnet_naming_symbols.unity_serialized_field_symbols_1.applicable_accessibilities = *
77+
dotnet_naming_symbols.unity_serialized_field_symbols_1.applicable_kinds =
78+
dotnet_naming_symbols.unity_serialized_field_symbols_1.resharper_applicable_kinds = unity_serialised_field
79+
dotnet_naming_symbols.unity_serialized_field_symbols_1.resharper_required_modifiers = instance
80+
dotnet_naming_symbols.unity_serialized_field_symbols_2.applicable_accessibilities = *
81+
dotnet_naming_symbols.unity_serialized_field_symbols_2.applicable_kinds =
82+
dotnet_naming_symbols.unity_serialized_field_symbols_2.resharper_applicable_kinds = unity_serialised_field
83+
dotnet_naming_symbols.unity_serialized_field_symbols_2.resharper_required_modifiers = instance
84+
dotnet_naming_symbols.unity_serialized_field_symbols_3.applicable_accessibilities = *
85+
dotnet_naming_symbols.unity_serialized_field_symbols_3.applicable_kinds =
86+
dotnet_naming_symbols.unity_serialized_field_symbols_3.resharper_applicable_kinds = unity_serialised_field
87+
dotnet_naming_symbols.unity_serialized_field_symbols_3.resharper_required_modifiers = instance
88+
dotnet_naming_symbols.unity_serialized_field_symbols_4.applicable_accessibilities = *
89+
dotnet_naming_symbols.unity_serialized_field_symbols_4.applicable_kinds =
90+
dotnet_naming_symbols.unity_serialized_field_symbols_4.resharper_applicable_kinds = unity_serialised_field
91+
dotnet_naming_symbols.unity_serialized_field_symbols_4.resharper_required_modifiers = instance
92+
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:none
93+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:none
94+
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:none
95+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
96+
dotnet_style_predefined_type_for_member_access = true:suggestion
97+
dotnet_style_qualification_for_event = false:suggestion
98+
dotnet_style_qualification_for_field = false:suggestion
99+
dotnet_style_qualification_for_method = false:suggestion
100+
dotnet_style_qualification_for_property = false:suggestion
101+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
102+
103+
# ReSharper properties
104+
resharper_autodetect_indent_settings = true
105+
resharper_braces_for_for = required
106+
resharper_braces_for_foreach = required
107+
resharper_braces_for_ifelse = required
108+
resharper_braces_for_while = required
109+
resharper_cpp_insert_final_newline = true
110+
resharper_csharp_stick_comment = false
111+
resharper_csharp_wrap_before_first_type_parameter_constraint = true
112+
resharper_formatter_off_tag = @formatter:off
113+
resharper_formatter_on_tag = @formatter:on
114+
resharper_formatter_tags_enabled = true
115+
resharper_for_other_types = use_var_when_evident
116+
resharper_keep_existing_declaration_parens_arrangement = false
117+
resharper_keep_existing_initializer_arrangement = false
118+
resharper_keep_existing_invocation_parens_arrangement = false
119+
resharper_max_array_initializer_elements_on_line = 10
120+
resharper_max_initializer_elements_on_line = 1
121+
resharper_max_invocation_arguments_on_line = 10
122+
resharper_place_accessorholder_attribute_on_same_line = false
123+
resharper_use_indent_from_vs = false
124+
resharper_wrap_before_eq = true
125+
resharper_xmldoc_space_after_last_pi_attribute = true
126+
127+
# ReSharper inspection severities
128+
resharper_arrange_redundant_parentheses_highlighting = hint
129+
resharper_arrange_this_qualifier_highlighting = hint
130+
resharper_arrange_type_member_modifiers_highlighting = hint
131+
resharper_arrange_type_modifiers_highlighting = hint
132+
resharper_built_in_type_reference_style_for_member_access_highlighting = hint
133+
resharper_built_in_type_reference_style_highlighting = hint
134+
resharper_check_namespace_highlighting = error
135+
resharper_mvc_action_not_resolved_highlighting = warning
136+
resharper_mvc_area_not_resolved_highlighting = warning
137+
resharper_mvc_controller_not_resolved_highlighting = warning
138+
resharper_mvc_masterpage_not_resolved_highlighting = warning
139+
resharper_mvc_partial_view_not_resolved_highlighting = warning
140+
resharper_mvc_template_not_resolved_highlighting = warning
141+
resharper_mvc_view_component_not_resolved_highlighting = warning
142+
resharper_mvc_view_component_view_not_resolved_highlighting = warning
143+
resharper_mvc_view_not_resolved_highlighting = warning
144+
resharper_razor_assembly_not_resolved_highlighting = warning
145+
resharper_redundant_base_qualifier_highlighting = warning
146+
resharper_suggest_var_or_type_simple_types_highlighting = suggestion
147+
resharper_web_config_module_not_resolved_highlighting = warning
148+
resharper_web_config_type_not_resolved_highlighting = warning
149+
resharper_web_config_wrong_module_highlighting = warning
150+
151+
[{*.yaml,*.yml}]
152+
indent_style = space
153+
indent_size = 2
154+
155+
[{*.bash,*.sh,*.zsh}]
156+
indent_style = space
157+
indent_size = 2
158+
159+
[{*.har,*.jsb2,*.jsb3,*.json,*.jsonc,*.postman_collection,*.postman_collection.json,*.postman_environment,*.postman_environment.json,*.sonarlint/*.json,.babelrc,.eslintrc,.prettierrc,.stylelintrc,.ws-context,connectedMode.json,jest.config}]
160+
indent_style = space
161+
indent_size = 2
162+
163+
[{tsconfig.app.json,tsconfig.base.json,tsconfig.e2e.json,tsconfig.editor.json,tsconfig.json,tsconfig.lib.json,tsconfig.spec.json,tsconfig.test.json}]
164+
indent_style = space
165+
indent_size = 2
166+
167+
[*.{appxmanifest,asax,ascx,aspx,axaml,blockshader,build,c,c++,c++m,cc,ccm,cginc,compute,cp,cpp,cppm,cs,cshtml,cu,cuh,cxx,cxxm,dtd,fs,fsi,fsscript,fsx,fx,fxh,h,h++,hh,hlsl,hlsli,hlslinc,hp,hpp,hxx,icc,inc,inl,ino,ipp,ixx,master,ml,mli,mpp,mq4,mq5,mqh,mxx,nuspec,paml,razor,resw,resx,shader,shaderFoundry,skin,tcc,tpp,urtshader,usf,ush,uxml,vb,xaml,xamlx,xoml,xsd}]
168+
indent_style = space
169+
indent_size = 4
170+
tab_width = 4
171+
172+
[*.{appxmanifest,asax,ascx,aspx,axaml,blockshader,c,c++,c++m,cc,ccm,cginc,compute,cp,cpp,cppm,cs,cshtml,cu,cuh,cxx,cxxm,dtd,feature,fs,fsi,fsscript,fsx,fx,fxh,h,h++,hh,hlsl,hlsli,hlslinc,hp,hpp,hxx,icc,inc,inl,ino,ipp,ixx,master,ml,mli,mpp,mq4,mq5,mqh,mxx,nuspec,paml,razor,resw,resx,shader,shaderFoundry,skin,tcc,tpp,urtshader,usf,ush,uxml,vb,xaml,xamlx,xoml,xsd}]
173+
indent_style = space
174+
indent_size = 4
175+
tab_width = 4

examples/csharp/Iggy_SDK.Examples.sln

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Iggy_SDK.Examples.MessageHe
3232
EndProject
3333
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Iggy_SDK.Examples.MessageHeaders.Producer", "src\MessageHeaders\Iggy_SDK.Examples.MessageHeaders.Producer\Iggy_SDK.Examples.MessageHeaders.Producer.csproj", "{FBA6F7E6-D92E-4E8F-81F0-625AE60F7E45}"
3434
EndProject
35+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NewSdk", "NewSdk", "{85F31923-45DF-4AEA-A28E-D37CF8E61A78}"
36+
EndProject
37+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Iggy_SDK.Examples.NewSdk.Consumer", "src\NewSdk\Iggy_SDK.Examples.NewSdk.Consumer\Iggy_SDK.Examples.NewSdk.Consumer.csproj", "{762203E3-A41B-414A-93BF-B963EAE447D1}"
38+
EndProject
39+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Iggy_SDK.Examples.NewSdk.Producer", "src\NewSdk\Iggy_SDK.Examples.NewSdk.Producer\Iggy_SDK.Examples.NewSdk.Producer.csproj", "{DB9EAC21-61C8-449A-95A9-6DC369B15C02}"
40+
EndProject
3541
Global
3642
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3743
Debug|Any CPU = Debug|Any CPU
@@ -81,6 +87,14 @@ Global
8187
{FBA6F7E6-D92E-4E8F-81F0-625AE60F7E45}.Debug|Any CPU.Build.0 = Debug|Any CPU
8288
{FBA6F7E6-D92E-4E8F-81F0-625AE60F7E45}.Release|Any CPU.ActiveCfg = Release|Any CPU
8389
{FBA6F7E6-D92E-4E8F-81F0-625AE60F7E45}.Release|Any CPU.Build.0 = Release|Any CPU
90+
{762203E3-A41B-414A-93BF-B963EAE447D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
91+
{762203E3-A41B-414A-93BF-B963EAE447D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
92+
{762203E3-A41B-414A-93BF-B963EAE447D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
93+
{762203E3-A41B-414A-93BF-B963EAE447D1}.Release|Any CPU.Build.0 = Release|Any CPU
94+
{DB9EAC21-61C8-449A-95A9-6DC369B15C02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
95+
{DB9EAC21-61C8-449A-95A9-6DC369B15C02}.Debug|Any CPU.Build.0 = Debug|Any CPU
96+
{DB9EAC21-61C8-449A-95A9-6DC369B15C02}.Release|Any CPU.ActiveCfg = Release|Any CPU
97+
{DB9EAC21-61C8-449A-95A9-6DC369B15C02}.Release|Any CPU.Build.0 = Release|Any CPU
8498
EndGlobalSection
8599
GlobalSection(NestedProjects) = preSolution
86100
{6CA0C169-109F-4A43-A21F-0792C1F865C8} = {3576C181-8BD5-4845-9CDA-835B33A29A29}
@@ -96,6 +110,9 @@ Global
96110
{578335B4-7B95-41D5-BB73-E965CAB2DBA4} = {3576C181-8BD5-4845-9CDA-835B33A29A29}
97111
{0A09EEAA-DDAE-44D3-926C-88910D661901} = {578335B4-7B95-41D5-BB73-E965CAB2DBA4}
98112
{FBA6F7E6-D92E-4E8F-81F0-625AE60F7E45} = {578335B4-7B95-41D5-BB73-E965CAB2DBA4}
113+
{85F31923-45DF-4AEA-A28E-D37CF8E61A78} = {3576C181-8BD5-4845-9CDA-835B33A29A29}
114+
{762203E3-A41B-414A-93BF-B963EAE447D1} = {85F31923-45DF-4AEA-A28E-D37CF8E61A78}
115+
{DB9EAC21-61C8-449A-95A9-6DC369B15C02} = {85F31923-45DF-4AEA-A28E-D37CF8E61A78}
99116
EndGlobalSection
100117
EndGlobal
101118

0 commit comments

Comments
 (0)