1594239420
Akka gRPC provides support for building streaming gRPC servers and clients on top of Akka Streams and Akka Http.
mvn compile dependency:properties exec:exec@server
7. Start the client for maven project
mvn compile dependency:properties exec:exec@client
syntax = "proto3";
option java_multiple_files = true;
option java_package = "com.knoldus.helloworld";
option java_outer_classname = "HelloWorldKnoldus";
// The greeting service definition.
service GreeterService {
// Sends a greeting
rpc SayHello (HelloRequest) returns (HelloReply) {}
}
message HelloRequest {
string name = 1;
}
message HelloReply {
string message = 1;
}
After compiling .proto file , the code will be generated
First, the GreeterServer main class creates an akka.actor.ActorSystem, a container in which Actors, Akka Streams and Akka HTTP run. Next, it defines a function from HttpRequest to Future[HttpResponse] using the GreeterServiceImpl. This function handles gRPC requests in the HTTP/2 with TLS server that is bound to port 8080 in this example.
#akka #akka-http #akka-streams #grpc #scala
1594239420
Akka gRPC provides support for building streaming gRPC servers and clients on top of Akka Streams and Akka Http.
mvn compile dependency:properties exec:exec@server
7. Start the client for maven project
mvn compile dependency:properties exec:exec@client
syntax = "proto3";
option java_multiple_files = true;
option java_package = "com.knoldus.helloworld";
option java_outer_classname = "HelloWorldKnoldus";
// The greeting service definition.
service GreeterService {
// Sends a greeting
rpc SayHello (HelloRequest) returns (HelloReply) {}
}
message HelloRequest {
string name = 1;
}
message HelloReply {
string message = 1;
}
After compiling .proto file , the code will be generated
First, the GreeterServer main class creates an akka.actor.ActorSystem, a container in which Actors, Akka Streams and Akka HTTP run. Next, it defines a function from HttpRequest to Future[HttpResponse] using the GreeterServiceImpl. This function handles gRPC requests in the HTTP/2 with TLS server that is bound to port 8080 in this example.
#akka #akka-http #akka-streams #grpc #scala
1592145840
Graphs
Till now we know how to create a linear pipeline/linear graph. But in real life scenario we generally don’t have linear graphs to implement. The graphs can be complex. In Akka Streams computation graphs are written in a more graph-resembling DSL. It aims to make translating graph drawings (e.g. from notes taken from design discussions, or illustrations in protocol specifications) to and from code simpler.
Graphs are used to perform fan-in and fan-out operations. You can consider graph operations as junctions(multiple flows connected at a single point).
Fan-in : It takes multiple inputs and produces a single output.
Fan-out : It produces multiple outputs by taking a single input.
#akka #akka-streams #big data and fast data #scala #akka-streaming #graphs #graphs-in-akka #partialgraphs
1595344320
Corona Virus Pandemic has brought the world to a standstill.
Countries are on a major lockdown. Schools, colleges, theatres, gym, clubs, and all other public places are shut down, the country’s economy is suffering, human health is on stake, people are losing their jobs and nobody knows how worse it can get.
Since most of the places are on lockdown, and you are working from home or have enough time to nourish your skills, then you should use this time wisely! We always complain that we want some ‘time’ to learn and upgrade our knowledge but don’t get it due to our ‘busy schedules’. So, now is the time to make a ‘list of skills’ and learn and upgrade your skills at home!
And for the technology-loving people like us, Knoldus Techhub has already helped us a lot in doing it in a short span of time!
If you are still not aware of it, don’t worry as Georgia Byng has well said,
“No time is better than the present”
– Georgia Byng, a British children’s writer, illustrator, actress and film producer.
No matter if you are a developer (be it front-end or back-end) or a data scientist, tester, or a DevOps person, or, a learner who has a keen interest in technology, Knoldus Techhub has brought it all for you under one common roof.
From technologies like Scala, spark, elastic-search to angular, go, machine learning, it has a total of 20 technologies with some recently added ones i.e. DAML, test automation, snowflake, and ionic.
Every technology in Tech-hub has n number of templates. Once you click on any specific technology you’ll be able to see all the templates of that technology. Since these templates are downloadable, you need to provide your email to get the template downloadable link in your mail.
These templates helps you learn the practical implementation of a topic with so much of ease. Using these templates you can learn and kick-start your development in no time.
Apart from your learning, there are some out of the box templates, that can help provide the solution to your business problem that has all the basic dependencies/ implementations already plugged in. Tech hub names these templates as xlr8rs (pronounced as accelerators).
xlr8rs make your development real fast by just adding your core business logic to the template.
If you are looking for a template that’s not available, you can also request a template may be for learning or requesting for a solution to your business problem and tech-hub will connect with you to provide you the solution. Isn’t this helpful 🙂
To keep you updated, the Knoldus tech hub provides you with the information on the most trending technology and the most downloaded templates at present. This you’ll be informed and learn the one that’s most trending.
Since we believe:
“There’s always a scope of improvement“
If you still feel like it isn’t helping you in learning and development, you can provide your feedback in the feedback section in the bottom right corner of the website.
#ai #akka #akka-http #akka-streams #amazon ec2 #angular 6 #angular 9 #angular material #apache flink #apache kafka #apache spark #api testing #artificial intelligence #aws #aws services #big data and fast data #blockchain #css #daml #devops #elasticsearch #flink #functional programming #future #grpc #html #hybrid application development #ionic framework #java #java11 #kubernetes #lagom #microservices #ml # ai and data engineering #mlflow #mlops #mobile development #mongodb #non-blocking #nosql #play #play 2.4.x #play framework #python #react #reactive application #reactive architecture #reactive programming #rust #scala #scalatest #slick #software #spark #spring boot #sql #streaming #tech blogs #testing #user interface (ui) #web #web application #web designing #angular #coronavirus #daml #development #devops #elasticsearch #golang #ionic #java #kafka #knoldus #lagom #learn #machine learning #ml #pandemic #play framework #scala #skills #snowflake #spark streaming #techhub #technology #test automation #time management #upgrade
1594167120
Hello friends, I hope you all are safe in COVID-19 pandemic and learning new tools and tech while staying at home.
In our last blog post on Akka Cluster, we learnt about the configurations we need in order to form an Akka Cluster. But we didn’t saw it in action. Hence in this blog post, we will see one in action.
To start with forming an Akka Cluster, download the Reactive Banking sample from Techhub.
It is a simple Akka application for managing customer credibility money as part of the Reactive Banking system. It is built using Akka HTTP and Akka Cluster Sharding. It includes a credibility program that allows users to accumulate money each time they add money in their account. Once they have accumulated enough money they can debit that money. This is a skeleton of the Credibility Service with a minimal feature set. It allows us to credit money to an account and debit money from the account. It also ensures that an account balance never goes below zero (You can’t debit money that you don’t have).
Now we are ready to run our first node which has to be the first seed node. Since we are going to run many nodes on one machine we have to use different port. Hence for first node we will use port: 2551
$ sbt "run -Dakka.http.server.default-http-port=8000 -Dakka.remote.artery.canonical.port=2551 -Dakka.management.http.port=8558"
Before we execute this command, let’s first understand it:
Now when we understand the configurations provided with the sbt command, let’s run our first node of the Akka Cluster.
In the above image, we can see that since there is only one node of the Akka Cluster running, it will join with itself and it will become the leader.
#akka #akka-http #reactive programming #scala #tech blogs #akka-cluster
1591916760
Hola, does your application have a client-server architecture or microservices architecture or distributed architecture? Then, you must be using some kind of protocol for inter-application communication or you want to get started with one. So, Let’s start digging.
#grpc #microservices #scala #tech blogs #grpc frameworks #what is grpc