HOCON | C # implementation of Lightbend 's HOCON | JSON Processing library

 by   akkadotnet C# Version: 2.0.4 License: Apache-2.0

kandi X-RAY | HOCON Summary

kandi X-RAY | HOCON Summary

HOCON is a C# library typically used in Utilities, JSON Processing applications. HOCON has no vulnerabilities, it has a Permissive License and it has low support. However HOCON has 1 bugs. You can download it from GitHub.

C# implementation of Typesafe's HOCON (Human-Optimized Object Configuration Notation).
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              HOCON has a low active ecosystem.
              It has 108 star(s) with 36 fork(s). There are 11 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 10 open issues and 68 have been closed. On average issues are closed in 95 days. There are 24 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of HOCON is 2.0.4

            kandi-Quality Quality

              HOCON has 1 bugs (0 blocker, 0 critical, 1 major, 0 minor) and 0 code smells.

            kandi-Security Security

              HOCON has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              HOCON code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              HOCON is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              HOCON releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              HOCON saves you 14 person hours of effort in developing the same functionality from scratch.
              It has 41 lines of code, 0 functions and 100 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of HOCON
            Get all kandi verified functions for this library.

            HOCON Key Features

            No Key Features are available at this moment for HOCON.

            HOCON Examples and Code Snippets

            No Code Snippets are available at this moment for HOCON.

            Community Discussions

            QUESTION

            Using Akka.net with IConfiguration
            Asked 2021-Oct-01 at 14:14

            Almost all Akka.net documentation refers to documentation through HOCON in some form. From my understanding, HOCON was made to tackle issues related to XML-based configuration in .NET Framework. Now that everything in JSON-based (starting in .NET Core), I would really want to configure Akka.net through appsettings.json, just like any other service I write in .NET. Some solutions I have found to this approach seem rather hacky by pasting a HOCON string in the appsettings file, or have the HOCON object inline in the source code. It would be very nice to have it within an appsettings since this fits better in how both my team manages configuration, deployment-wise, and modern .NET applications approach configuration.

            Why is Akka.net using HOCON instead of a more abstract interface such as IConfiguration, and how can I best configure it by following best practices in .NET using appsettings.json and IConfiguration?

            ...

            ANSWER

            Answered 2021-Oct-01 at 14:14

            I believe one of the reasons why Akka.net uses HOCON is due to how it is a 1-1 port of Akka (Java), which also heavily relies on HOCON for configuration. For portability it is then the preferred format for configuring the framework. While it is just speculation from my side, it could be a priority thing why there is no support for IConfiguration since the current way of configuration "just works" even though it fits poorly together with how newer .NET applications are written today.

            There are a few ways that the Akka.Configuration.Config can be built from an IConfiguration instance. One way is to take the IConfiguration object, and construct a JSON string from it, then give it to ConfigurationFactory.ParseString which does support parsing JSON. A HOCON representation can then be obtained from the parsed Config instance. In order to correctly parse a JSON object, the generated HOCON string has to parsed again (my guess is because of a bug that makes it interpret JSON and HOCON differently). Make sure the JSON config does not contain any properties such as {"foo.don" : "bar"}, while HOCON supports resolving foo.don - JSON does not. Below is the extension method I put together for parsing a Config from an IConfiguration instance:

            Source https://stackoverflow.com/questions/69256760

            QUESTION

            ktor hocon configuration not working for one password variable
            Asked 2021-Oct-01 at 08:21

            I am setting up a ktor api that connects with a postgres container in docker. I can get everything working when I hard code things. When I try to use the hocon config and print values I can see my dburl and dbuser but when I print my dbpassword I get an address like value.

            Here is my hocon config:

            ...

            ANSWER

            Answered 2021-Oct-01 at 08:21

            The problem is that the last call for getting value of db.dbPassword is toString instead of getString.

            Source https://stackoverflow.com/questions/69400124

            QUESTION

            Akka.net: Should I specify "split brain resolver" configuration for Lighthouse/Seed nodes
            Asked 2021-Sep-17 at 16:36

            I have this application using Akka.net cluster feature. The people who wrote the code have left the company. I am trying to understand the code and we are planning a deployment.

            The cluster has 2 types of nodes

            QueueServicer: supports sharding and only these nodes should participate in sharding.
            LightHouse: They are just seed nodes, nothing else.

            Lighthouse : 2 nodes
            QueueServicer : 3 Nodes

            I see one of the QueueServicer node unable to join the cluster. Both lighthouse nodes are refusing connection. It constantly tries to join and never succeeds. This has been happening for the last 5 days or so and the node is never dying also. Its CPU and memory usage is high. Also It doesn't have any queue processor actors running when filtered search through the log. It takes long hours for Garbage collection etc. I see in the log for this node, the following.

            {"timestamp":"2021-09-08T22:26:59.025Z", "logger":"Akka.Event.DummyClassForStringSources", "message":Tried to associate with unreachable remote address [akka.tcp://myapp@lighthouse-1:7892]. Address is now gated for 5000 ms, all messages to this address will be delivered to dead letters. Reason: [Association failed with akka.tcp://myapp@lighthouse-1:7892] Caused by: [System.AggregateException: One or more errors occurred. (Connection refused akka.tcp://myapp@lighthouse-1:7892) ---> Akka.Remote.Transport.InvalidAssociationException: Connection refused akka.tcp://myapp@lighthouse-1:7892 at Akka.Remote.Transport.DotNetty.TcpTransport.AssociateInternal(Address remoteAddress) at Akka.Remote.Transport.DotNetty.DotNettyTransport.Associate(Address remoteAddress) --- End of inner exception stack trace --- at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at Akka.Remote.Transport.ProtocolStateActor.<>c.b__12_18(Task1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

            {"timestamp":"2021-09-08T22:26:59.025Z", "logger":"Akka.Event.DummyClassForStringSources", "message":Tried to associate with unreachable remote address [akka.tcp://myapp@lighthouse-0:7892]. Address is now gated for 5000 ms, all messages to this address will be delivered to dead letters. Reason: [Association failed with akka.tcp://myapp@lighthouse-0:7892] Caused by: [System.AggregateException: One or more errors occurred. (Connection refused akka.tcp://myapp@lighthouse-0:7892) ---> Akka.Remote.Transport.InvalidAssociationException: Connection refused akka.tcp://myapp@lighthouse-0:7892 at Akka.Remote.Transport.DotNetty.TcpTransport.AssociateInternal(Address remoteAddress) at Akka.Remote.Transport.DotNetty.DotNettyTransport.Associate(Address remoteAddress) --- End of inner exception stack trace --- at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at Akka.Remote.Transport.ProtocolStateActor.<>c.b__12_18(Task1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

            There are other "Now supervising", "Stopping" "Started" logs which I am omitting here.

            Can you please verify if the HCON config is correct for split brain resolver and Sharding?

            I think LightHouse/SeeNodes should not have the sharding configuration specified. I think it is a mistake. I also think, split brain resolver configuration might be wrong in LightHouse/SeedNodes and should not be specified for seed nodes.

            I appreciate your help.

            Here is the HOCON for QueueServicer Trimmed

            akka {
                loggers = ["Akka.Logger.log4net.Log4NetLogger, Akka.Logger.log4net"]
                log-config-on-start = on
                loglevel = "DEBUG"
                actor {
                    provider = cluster
                    serializers {
                        hyperion = "Akka.Serialization.HyperionSerializer, Akka.Serialization.Hyperion"
                    }
                    serialization-bindings {
                        "System.Object" = hyperion
                    }
                }

            ...

            ANSWER

            Answered 2021-Sep-17 at 16:36

            I meant to reply to this sooner.

            Here is your problem: you're using two different split brain resolver configurations - one for the QueueServicer and one for Lighthouse. Therefore, how your cluster resolves itself is going to be quite different depending upon who is the leader of each half of the cluster.

            I would stick with a simple keep-majority strategy and use it uniformly on all nodes throughout the cluster - we're very likely going to enable this by default in Akka.NET v1.5.

            If you have any questions, please feel free to reach out to us: https://petabridge.com/

            Source https://stackoverflow.com/questions/69110696

            QUESTION

            Helm - How to write a file in a Volume using ConfigMap?
            Asked 2021-May-08 at 13:34

            I have defined the values.yaml like the following:

            ...

            ANSWER

            Answered 2021-May-08 at 13:34

            I was able to resolve the issue. The issue was using configmap in place configMap in deployment.yaml:

            Source https://stackoverflow.com/questions/67446985

            QUESTION

            How can I use Akka.NET lighthouse with hyperion
            Asked 2021-Mar-09 at 17:36

            Currently I'm using the akka.net lighthouse docker image which is on dockerhub. Together with Akka.Bootstrap.Docker it's nice to override akka hocon configuration from the environment variables. I've set the following environment variables in my k8s deployment file

            ...

            ANSWER

            Answered 2021-Mar-09 at 17:36

            Akka.NET is trying to load hyperion serializer via Type.GetType("Akka.Serialization.HyperionSerializer, Akka.Serialization.Hyperion") call, and fails to do that, because Lighthouse docker image does not include Akka.Serialization.Hyperion package.

            So what you need to do is:

            1. Clone Lighthouse repo and add Akka.Serialization.Hyperion package to Lighthouse project references
            2. Build your own docker image and use it instead.

            Source https://stackoverflow.com/questions/66550613

            QUESTION

            Load config from file and use it in rust code everywhere
            Asked 2021-Feb-07 at 17:58

            I'm new to rust and want to understand how to load config from file to use it in code.

            In main.rs and other files i want to use config loaded from file:

            ...

            ANSWER

            Answered 2021-Feb-07 at 17:58

            QUESTION

            Parsing an empty property into an empty Map with PureConfig
            Asked 2021-Jan-12 at 16:05

            I have a case class like the following:

            ...

            ANSWER

            Answered 2021-Jan-12 at 15:49

            As @LuisMiguelMejíaSuárez suggested in the comment, you should add a default argument:

            Source https://stackoverflow.com/questions/65686354

            QUESTION

            How to censor/hide a HOCON value from appearing in Ktor logs
            Asked 2020-Dec-10 at 13:18

            Using Ktor as a web server and configuring it with the (HOCON) application.conf file.

            I've setup a default password for connecting to a database in the configuration, as well as the ability for it to be overridden with an environment variable.

            When the server starts, the configurations is printed to the console (and probably in future stored in logs), the problem is that the password is plainly visible.

            Does anyone know of a way to prevent this?

            Representative application.conf:

            ...

            ANSWER

            Answered 2020-Dec-10 at 13:18

            You can put your parameters with sensitive values inside the security section to make them hidden inside logs. Here is an example:

            Source https://stackoverflow.com/questions/65107714

            QUESTION

            @PropertySource(factory=...) breaks @SpringBootTest when loading META-INF/build-info.properties
            Asked 2020-Sep-27 at 22:35

            I am trying to setup a custom @ConfigurationProperties class loaded from a HOCON syntax .conf file.

            I have a Class annotated with @PropertySource(factory=TypesafePropertySourceFactory.class, value = "classpath:app.conf")

            ...

            ANSWER

            Answered 2020-Sep-25 at 08:58

            Maybe you can also solve it with the use of a ContextInitializer as suggested in the answer here:

            Spring Environment backed by Typesafe Config

            Source https://stackoverflow.com/questions/64059677

            QUESTION

            Read Hocon config as a Map[String, String] with key in dot notation and value
            Asked 2020-Sep-26 at 20:18

            I have following HOCON config:

            ...

            ANSWER

            Answered 2020-Sep-20 at 14:05

            You can do the same without using recursion. Use method entrySet as following

            Source https://stackoverflow.com/questions/63964237

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install HOCON

            To install HOCON via NuGet:.
            If you need access to nightly HOCON builds, you can get them via the Akka.NET nightly build NuGet feed.
            To install Microsoft.Extensions.Configuration via NuGet:.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular JSON Processing Libraries

            json

            by nlohmann

            fastjson

            by alibaba

            jq

            by stedolan

            gson

            by google

            normalizr

            by paularmstrong

            Try Top Libraries by akkadotnet

            akka.net

            by akkadotnetC#

            Hyperion

            by akkadotnetC#

            Alpakka

            by akkadotnetC#

            Akka.Streams.Kafka

            by akkadotnetC#