Gordon  Murray

Gordon Murray

1670684229

Learn Fundamentals Of Micronaut and Its Features

In this blog, we will discuss Micronaut in context of what and why, and we will also see how to create an application from Micronaut launch.

Before taking a deep dive into Micronaut, let us get familiar with some of the associated terminologies. Having this information will help us better understand it.

Ahead of time compilation(AOT) – It is the pre-computation of application code using closed-world static analysis. A fancy way of saying, do more at compile time and less at run time.

Reflection – Reflection in Java is an API (Application Programming Interface) that analyzes or changes classes, methods, and interfaces during runtime. It involves examining or making changes to the run-time behavior of a class.

What is Micronaut?

The Micronaut framework is designed for building lightweight, modular applications, and microservices in the cloud. It’s an open-source JVM-based framework tailored for building and testing low-memory microservices, serverless applications, and message-driven microservices based on cloud architecture.

Micronaut uses ahead-of-time (AOT) compilation to pre-compute the application requirements at compile time. As a result, significantly less memory is consumed, startup times are shortened, and reflection is eliminated from the framework infrastructure.

In contrast to other frameworks, Micronaut does not depend on the size of the application’s codebase for startup time and memory consumption. This is because it analyzes metadata and builds its dependency injection at compilation time instead of runtime, which makes integration testing faster and easier.

A unique characteristic of Micronaut is that it does not modify byte code during compilation time, and it removes all reflection levels. Thus, maximum speed can be achieved at runtime.

Why Micronaut?

Micronaut incorporates existing microservices patterns that developers rely on, helping to eliminate the need to piece together separate tools and frameworks.

Features that make it so well suited for microservices.

  • Support for frameworks that implement the Reactive Streams standard.
  • Support for messaging systems like Kafka, RabbitMQ, MQTT, JMS, and Nats.io.
  • Supports serverless functions for cloud providers like AWS Lambda, Oracle Functions, Google Cloud Functions, and Azure Functions.
  • Supports OpenAPI documentation by creating a YAML file at compilation time.
  • GraalVM readiness to further reduce startup time. 

Pros and Cons of Micronaut

Pros

  • Cloud Native framework for web applications and microservices
  • Compile time reflection
  • Minimal cold startup time and memory use
  • Reactive stack
  • Polyglot framework (Supports Java, Kotlin, Groovy)
  • Minimal use of proxies
  • No runtime bytecode generation
  • Easy unit testing

Cons

  • Smaller community

How to create a Micronaut application?

There are multiple ways to create an application and the fastest way without installing anything is to go to the micronaut.io homepage.

On the top right corner, there is a button with the text LAUNCH. 

micronaut.io homepage

Upon clicking this button, a new page opens where the application can be configured.

Micronaut Launch page

This page is called Micronaut Launch. It provides a lot of settings for creating an application.

It is possible to define multiple application types like a command line, serverless, gRPC, and messaging-driven application. Select the standard Micronaut application type.

Micronaut Launch page

Then select Java version 17.

Micronaut Launch page

Next specify name and base package. According to Java package guidelines, the base package name should be the domain name in reverse order.

Micronaut Launch page

Choose Micronaut version 3.7.2. Then select Java as the programming language. As build tools, Gradle and Maven can be used. Ensure that Maven is selected. Lastly, select JUnit as the test framework.Micronaut Launch page

There is a line of buttons at the bottom.

Micronaut Launch page

The leftmost button is called “FEATURES”. On clicking it, a pop-up opens that lists all the modules Micronaut can support.

Micronaut Launch page

Now search and select netty-server as the runtime.

Micronaut Launch page

Micronaut Launch page

Before we generate the project, we can inspect the diff, which is quite handy when adding new features. For now, click “PREVIEW” as we are creating a new project.

Micronaut Launch page

Clicking the “PREVIEW” button allows viewing the source structure. The application has a standard Java structure that includes a pom.xml, a maven wrapper, and a source folder.

To generate the project, close this preview and press the “GENERATE PROJECT” button. It is possible to push a project directly to GitHub, download as a zip and use some commands to generate a project. Click on Download Zip to download the project as a zip file. Now unzip the zip file and open it in IntelliJ.

Micronaut Launch page

There is a Application class containing the Java main method. This class contains the static Micronaut.run method, which is the starting point for the application.

Application Image

For configuring the application, there is an application.yml file.

Application Image

By default, Micronaut includes the logback logging implementation in the logback.xml file.

Application Image

There is also DemoAppTest class which contains one test method asserting that the application can start up.

Application Image

Run the test case to see if that works.

Application Image

The log output indicates the use of a test environment. By the way, Micronaut has built in support for different environments, which is quite nice.

There is also the micronaut-cli.yml file, which uses Micronaut CLI along with it. It’s meta information when using CLI commands.

Application Image

And as its a Maven project, so there is a pom.xml file. This file contains all the dependencies.

Application Image

Now head back to the Application class and run the application. The console output shows the Micronaut banner, the version, and the log that startup took 3473 milliseconds.Application Image

We can also create an application through Micronaut CLI. For more information on creating an application through the CLI, click here.

References

To know more about Micronaut, you can visit this link.

Click here to learn more about reflection in Java.

To read more tech blogs, feel free to visit Knoldus Blogs.

Original article source at: https://blog.knoldus.com/

#micronaut #features 

What is GEEK

Buddha Community

Learn Fundamentals Of Micronaut and Its Features
Jerad  Bailey

Jerad Bailey

1598891580

Google Reveals "What is being Transferred” in Transfer Learning

Recently, researchers from Google proposed the solution of a very fundamental question in the machine learning community — What is being transferred in Transfer Learning? They explained various tools and analyses to address the fundamental question.

The ability to transfer the domain knowledge of one machine in which it is trained on to another where the data is usually scarce is one of the desired capabilities for machines. Researchers around the globe have been using transfer learning in various deep learning applications, including object detection, image classification, medical imaging tasks, among others.

#developers corner #learn transfer learning #machine learning #transfer learning #transfer learning methods #transfer learning resources

E-Learning App Development: Types, Cost & Features

The growth of the online modes for students has increased since the pandemic. This growth has been possible with the help of E-learning software systems. This software has shown a future with more opportunities, even in this pandemic. This market will grow to a high of 350 billion dollars by 2025. Due to this pandemic, most education organizations have shifted to online modes. So, naturally, this means the need for E-learning software systems will grow. So, do you have a complete idea for your E-learning applications and are planning to develop one for your organization? E-learning product development is not a very difficult process to handle. To make the process easier for you, we have added the types of e-learning apps, its features, benefits, development cost and much more in this blog. To read more click on the link.

#e-learning web portals #e-learning development companies #development of software for e-learning #e-learning web portalsmobile applications for e-learning #e-learning product development #app development

Gordon  Murray

Gordon Murray

1670684229

Learn Fundamentals Of Micronaut and Its Features

In this blog, we will discuss Micronaut in context of what and why, and we will also see how to create an application from Micronaut launch.

Before taking a deep dive into Micronaut, let us get familiar with some of the associated terminologies. Having this information will help us better understand it.

Ahead of time compilation(AOT) – It is the pre-computation of application code using closed-world static analysis. A fancy way of saying, do more at compile time and less at run time.

Reflection – Reflection in Java is an API (Application Programming Interface) that analyzes or changes classes, methods, and interfaces during runtime. It involves examining or making changes to the run-time behavior of a class.

What is Micronaut?

The Micronaut framework is designed for building lightweight, modular applications, and microservices in the cloud. It’s an open-source JVM-based framework tailored for building and testing low-memory microservices, serverless applications, and message-driven microservices based on cloud architecture.

Micronaut uses ahead-of-time (AOT) compilation to pre-compute the application requirements at compile time. As a result, significantly less memory is consumed, startup times are shortened, and reflection is eliminated from the framework infrastructure.

In contrast to other frameworks, Micronaut does not depend on the size of the application’s codebase for startup time and memory consumption. This is because it analyzes metadata and builds its dependency injection at compilation time instead of runtime, which makes integration testing faster and easier.

A unique characteristic of Micronaut is that it does not modify byte code during compilation time, and it removes all reflection levels. Thus, maximum speed can be achieved at runtime.

Why Micronaut?

Micronaut incorporates existing microservices patterns that developers rely on, helping to eliminate the need to piece together separate tools and frameworks.

Features that make it so well suited for microservices.

  • Support for frameworks that implement the Reactive Streams standard.
  • Support for messaging systems like Kafka, RabbitMQ, MQTT, JMS, and Nats.io.
  • Supports serverless functions for cloud providers like AWS Lambda, Oracle Functions, Google Cloud Functions, and Azure Functions.
  • Supports OpenAPI documentation by creating a YAML file at compilation time.
  • GraalVM readiness to further reduce startup time. 

Pros and Cons of Micronaut

Pros

  • Cloud Native framework for web applications and microservices
  • Compile time reflection
  • Minimal cold startup time and memory use
  • Reactive stack
  • Polyglot framework (Supports Java, Kotlin, Groovy)
  • Minimal use of proxies
  • No runtime bytecode generation
  • Easy unit testing

Cons

  • Smaller community

How to create a Micronaut application?

There are multiple ways to create an application and the fastest way without installing anything is to go to the micronaut.io homepage.

On the top right corner, there is a button with the text LAUNCH. 

micronaut.io homepage

Upon clicking this button, a new page opens where the application can be configured.

Micronaut Launch page

This page is called Micronaut Launch. It provides a lot of settings for creating an application.

It is possible to define multiple application types like a command line, serverless, gRPC, and messaging-driven application. Select the standard Micronaut application type.

Micronaut Launch page

Then select Java version 17.

Micronaut Launch page

Next specify name and base package. According to Java package guidelines, the base package name should be the domain name in reverse order.

Micronaut Launch page

Choose Micronaut version 3.7.2. Then select Java as the programming language. As build tools, Gradle and Maven can be used. Ensure that Maven is selected. Lastly, select JUnit as the test framework.Micronaut Launch page

There is a line of buttons at the bottom.

Micronaut Launch page

The leftmost button is called “FEATURES”. On clicking it, a pop-up opens that lists all the modules Micronaut can support.

Micronaut Launch page

Now search and select netty-server as the runtime.

Micronaut Launch page

Micronaut Launch page

Before we generate the project, we can inspect the diff, which is quite handy when adding new features. For now, click “PREVIEW” as we are creating a new project.

Micronaut Launch page

Clicking the “PREVIEW” button allows viewing the source structure. The application has a standard Java structure that includes a pom.xml, a maven wrapper, and a source folder.

To generate the project, close this preview and press the “GENERATE PROJECT” button. It is possible to push a project directly to GitHub, download as a zip and use some commands to generate a project. Click on Download Zip to download the project as a zip file. Now unzip the zip file and open it in IntelliJ.

Micronaut Launch page

There is a Application class containing the Java main method. This class contains the static Micronaut.run method, which is the starting point for the application.

Application Image

For configuring the application, there is an application.yml file.

Application Image

By default, Micronaut includes the logback logging implementation in the logback.xml file.

Application Image

There is also DemoAppTest class which contains one test method asserting that the application can start up.

Application Image

Run the test case to see if that works.

Application Image

The log output indicates the use of a test environment. By the way, Micronaut has built in support for different environments, which is quite nice.

There is also the micronaut-cli.yml file, which uses Micronaut CLI along with it. It’s meta information when using CLI commands.

Application Image

And as its a Maven project, so there is a pom.xml file. This file contains all the dependencies.

Application Image

Now head back to the Application class and run the application. The console output shows the Micronaut banner, the version, and the log that startup took 3473 milliseconds.Application Image

We can also create an application through Micronaut CLI. For more information on creating an application through the CLI, click here.

References

To know more about Micronaut, you can visit this link.

Click here to learn more about reflection in Java.

To read more tech blogs, feel free to visit Knoldus Blogs.

Original article source at: https://blog.knoldus.com/

#micronaut #features 

sophia tondon

sophia tondon

1620898103

5 Latest Technology Trends of Machine Learning for 2021

Check out the 5 latest technologies of machine learning trends to boost business growth in 2021 by considering the best version of digital development tools. It is the right time to accelerate user experience by bringing advancement in their lifestyle.

#machinelearningapps #machinelearningdevelopers #machinelearningexpert #machinelearningexperts #expertmachinelearningservices #topmachinelearningcompanies #machinelearningdevelopmentcompany

Visit Blog- https://www.xplace.com/article/8743

#machine learning companies #top machine learning companies #machine learning development company #expert machine learning services #machine learning experts #machine learning expert

Jackson  Crist

Jackson Crist

1617331066

Intro to Reinforcement Learning: Temporal Difference Learning, SARSA Vs. Q-learning

Reinforcement learning (RL) is surely a rising field, with the huge influence from the performance of AlphaZero (the best chess engine as of now). RL is a subfield of machine learning that teaches agents to perform in an environment to maximize rewards overtime.

Among RL’s model-free methods is temporal difference (TD) learning, with SARSA and Q-learning (QL) being two of the most used algorithms. I chose to explore SARSA and QL to highlight a subtle difference between on-policy learning and off-learning, which we will discuss later in the post.

This post assumes you have basic knowledge of the agent, environment, action, and rewards within RL’s scope. A brief introduction can be found here.

The outline of this post include:

  • Temporal difference learning (TD learning)
  • Parameters
  • QL & SARSA
  • Comparison
  • Implementation
  • Conclusion

We will compare these two algorithms via the CartPole game implementation. This post’s code can be found here :QL code ,SARSA code , and the fully functioning code . (the fully-functioning code has both algorithms implemented and trained on cart pole game)

The TD learning will be a bit mathematical, but feel free to skim through and jump directly to QL and SARSA.

#reinforcement-learning #artificial-intelligence #machine-learning #deep-learning #learning