You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@celix.apache.org by GitBox <gi...@apache.org> on 2020/05/18 06:41:28 UTC

[GitHub] [celix] pnoltes commented on a change in pull request #223: Feature/pubsub custom serializers

pnoltes commented on a change in pull request #223:
URL: https://github.com/apache/celix/pull/223#discussion_r426398791



##########
File path: bundles/pubsub/pubsub_utils/src/pubsub_serializer_handler.c
##########
@@ -0,0 +1,360 @@
+/**
+ *Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements.  See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership.  The ASF licenses this file
+ *to you under the Apache License, Version 2.0 (the
+ *"License"); you may not use this file except in compliance
+ *with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *Unless required by applicable law or agreed to in writing,
+ *software distributed under the License 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.
+ */
+
+
+#include "pubsub_serializer_handler.h"
+
+#include <string.h>
+
+#include "celix_version.h"
+#include "pubsub_message_serialization_service.h"
+#include "celix_log_helper.h"
+
+#define L_DEBUG(...) \
+    celix_logHelper_debug(handler->logHelper, __VA_ARGS__)
+#define L_INFO(...) \
+    celix_logHelper_info(handler->logHelper, __VA_ARGS__)
+#define L_WARN(...) \
+    celix_logHelper_warning(handler->logHelper, __VA_ARGS__)
+#define L_ERROR(...) \
+    celix_logHelper_error(handler->logHelper, __VA_ARGS__)
+
+typedef struct pubsub_serialization_service_entry {
+    long svcId;
+    const celix_properties_t *properties;
+    uint32_t msgId;
+    celix_version_t* msgVersion;
+    char* msgFqn;
+    pubsub_message_serialization_service_t* svc;
+} pubsub_serialization_service_entry_t;
+
+struct pubsub_serializer_handler {
+    celix_bundle_context_t* ctx;
+    bool backwardCompatible;
+    long serializationSvcTrackerId;
+    celix_log_helper_t *logHelper;
+
+    celix_thread_rwlock_t lock;
+    hash_map_t *serializationServices; //key = msg id, value = sorted array list with pubsub_serialization_service_entry_t*
+};
+
+static void addSvc(void *handle, void* svc, const celix_properties_t *props) {

Review comment:
       renamec




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org