ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in'tKonrad Malawski
Â
A talk about the implications and context around API design. How APIs come to be and how to understand them. This talk was delivered as opening keynote, setting the tone, for the ScalaSwarm conference in Porto, Portugal in 2017.
The things we don't see â stories of Software, Scala and AkkaKonrad Malawski
Â
Opening keynote for Scalapeno, Tel Aviv 2016.
The talk focuses and explains the things we don't often see explicitly and/or don't notice when doing our daily work, yet make up a large part of the ecosystem and maturity of the ecoststem as a whole. We also dive into some of the more confusing bits around using the same word about different things in software
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in'tKonrad Malawski
Â
A talk about the implications and context around API design. How APIs come to be and how to understand them. This talk was delivered as opening keynote, setting the tone, for the ScalaSwarm conference in Porto, Portugal in 2017.
The things we don't see â stories of Software, Scala and AkkaKonrad Malawski
Â
Opening keynote for Scalapeno, Tel Aviv 2016.
The talk focuses and explains the things we don't often see explicitly and/or don't notice when doing our daily work, yet make up a large part of the ecosystem and maturity of the ecoststem as a whole. We also dive into some of the more confusing bits around using the same word about different things in software
Presentation to describe about Circuit Breakers, where to apply, how and examples. Using the Netflix Hystrix and Spring Retry to demonstrate how and examples available on Github.
https://github.com/BHRother/spring-hystrix-example
https://github.com/BHRother/spring-circuit-breaker-example
Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/1DXFg0h.
Ben Christensen summarizes why the Rx programming model was chosen and demonstrates how it is applied to a variety of use cases. Filmed at qconsf.com.
Ben Christensen is a software engineer on the Netflix Edge Services Platform team responsible for fault tolerance, performance, architecture and scale while enabling millions of customers to access the Netflix experience across more than 1,000 different device types.
Distributed Consensus A.K.A. "What do we eat for lunch?"Konrad Malawski
Â
Distributed Consensus is everywhere! Even if not obvious at first, most apps nowadays are distributed systems, and these sometimes have to "agree on a value", this is where consensus algorithms come in. In this session we'll look at the general problem and solve a few example cases using the RAFT algorithm implemented using Akka's Actor and Cluster modules.
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYCKonrad Malawski
Â
Intense 3 hour workshop covering Akka Actors, Cluster, Streams, HTTP and more. Including very advanced patterns.
Presented with Henrik Engstrom at O'Reilly Software Architecture Conference in New York City in 2017
One of the most common performance issues in serverless architectures is elevated latencies from external services, such as DynamoDB, ElasticSearch or Stripe.
In this webinar, we will show you how to quickly identify and debug these problems, and some best practices for dealing with poor performing 3rd party services.
Resilience becomes a must. Actually resilience is an issue for a long time, but with ever-increasing distribution it becomes a must. But how can we implement resilience into our applications? Hystrix, an open-source library developed by Netflix provides a nice starting point. It provides downstream isolation by implementing patterns like timeout, circuit breaker and load shedder. This presentation gives an introduction into Hystrix, providing lots of code examples.
Multithreading and concurrency in androidRakesh Jha
Â
Here you will learn -
What is Multithreading
What is concurrency
Process Vs Thread
 Improvements and issues with concurrency
Limits of concurrency gains
Concurrency issues
Threads pools with the Executor Framework
AsyncTask and the UI Thread
Code
Presentation to describe about Circuit Breakers, where to apply, how and examples. Using the Netflix Hystrix and Spring Retry to demonstrate how and examples available on Github.
https://github.com/BHRother/spring-hystrix-example
https://github.com/BHRother/spring-circuit-breaker-example
Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/1DXFg0h.
Ben Christensen summarizes why the Rx programming model was chosen and demonstrates how it is applied to a variety of use cases. Filmed at qconsf.com.
Ben Christensen is a software engineer on the Netflix Edge Services Platform team responsible for fault tolerance, performance, architecture and scale while enabling millions of customers to access the Netflix experience across more than 1,000 different device types.
Distributed Consensus A.K.A. "What do we eat for lunch?"Konrad Malawski
Â
Distributed Consensus is everywhere! Even if not obvious at first, most apps nowadays are distributed systems, and these sometimes have to "agree on a value", this is where consensus algorithms come in. In this session we'll look at the general problem and solve a few example cases using the RAFT algorithm implemented using Akka's Actor and Cluster modules.
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYCKonrad Malawski
Â
Intense 3 hour workshop covering Akka Actors, Cluster, Streams, HTTP and more. Including very advanced patterns.
Presented with Henrik Engstrom at O'Reilly Software Architecture Conference in New York City in 2017
One of the most common performance issues in serverless architectures is elevated latencies from external services, such as DynamoDB, ElasticSearch or Stripe.
In this webinar, we will show you how to quickly identify and debug these problems, and some best practices for dealing with poor performing 3rd party services.
Resilience becomes a must. Actually resilience is an issue for a long time, but with ever-increasing distribution it becomes a must. But how can we implement resilience into our applications? Hystrix, an open-source library developed by Netflix provides a nice starting point. It provides downstream isolation by implementing patterns like timeout, circuit breaker and load shedder. This presentation gives an introduction into Hystrix, providing lots of code examples.
Multithreading and concurrency in androidRakesh Jha
Â
Here you will learn -
What is Multithreading
What is concurrency
Process Vs Thread
 Improvements and issues with concurrency
Limits of concurrency gains
Concurrency issues
Threads pools with the Executor Framework
AsyncTask and the UI Thread
Code
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...Flink Forward
Â
In this session, we will look at how Apache Flink can be used to stream anonymized API request and response data from a production environment to make sure staging environments are up-to-date and reflect the most recent features (and bugs) that comprise a service. The talk will also examine how to deal with issues of data retention, throttling, and persistence, finishing with recommendations for how to use these sandbox environments to rapidly prototype and test new features and fixes.
Watch How The Giants Fall: Learning from Bug Bounty Resultsjtmelton
Â
Security is hard. We all miss things. Attackers find things.
"You must learn from the mistakes of others. You can't possibly live long enough to make them all yourself." -Samuel Levenson
This talk is a fun, fast-moving survey of some of the best recent bug bounty finds against some of the largest and best-known applications in the world. Some of the bugs are really simple, some are super complex, but all are entertaining. As we go through these, we'll take a look at what caused the issue, and how to fix it.
From this talk, you'll walk away with:
* a few minutes of entertainment
* a view of the wide breadth of security issues
* practical ideas on testing and shoring up security in your own applications
* (maybe) a new side gig as a bug bounty hunter!
Talk given at ClueCon 2016 that discusses FreeSWITCH and its place in a microservices architecture. Covers a specific deployment case using Docker and Adhearsion, along with certain features that make FreeSWITCH a model use-case for such a technology stack.
Mock what? What Mock?Learn What is Mocking, and how to use Mocking with ColdFusion testing, development, and continuous integration. Look at Mocking and Stubbing with a touch of Theory and a lot of Examples, including what you could test, and what you should test⌠and what you shouldn't test (but might be fun).
Integrate Solr with real-time stream processing applicationsthelabdude
Â
Storm is a real-time distributed computation system used to process massive streams of data. Many organizations are turning to technologies like Storm to complement batch-oriented big data technologies, such as Hadoop, to deliver time-sensitive analytics at scale. This talk introduces on an emerging architectural pattern of integrating Solr and Storm to process big data in real time. There are a number of natural integration points between Solr and Storm, such as populating a Solr index or supplying data to Storm using Solrâs real-time get support. In this session, Timothy will cover the basic concepts of Storm, such as spouts and bolts. Heâll then provide examples of how to integrate Solr into Storm to perform large-scale indexing in near real-time. In addition, we'll see how to embed Solr in a Storm bolt to match incoming tuples against pre-configured queries, commonly known as percolator. Attendees will come away from this presentation with a good introduction to stream processing technologies and several real-world use cases of how to integrate Solr with Storm.
What We Learned About Cassandra While Building go90 (Christopher Webster & Th...DataStax
Â
Go90 is a mobile entertainment platform offering access to live and on demand videos. We built the web services platform and social features like activity feed for go90 by making heavy use of Cassandra and Scala, and would like to share what we learned during development and while operating go90. In this presentation, we cover our data model evolution from the initial prototypes to the current production version and the significant performance gain by using a better data model. We will explain how we apply time series data modeling and the benefits of using expiring columns with DateTieredCompactionStrategy. We will also talk about interesting experiences related to table modifications, tombstones and table pagination. On the operations side, we will discuss our findings on java driver usage, performance, monitoring, cluster maintenance, version upgrade, 2-way ssl and many more. We hope you can learn from our mistakes instead of making them yourself!
About the Speakers
Christopher Webster Software Engineer, AOL
Christopher Webster works on the web services platform for the go90 AOL project. Previously he was a Computer Scientist for the Mission Control Technologies project at NASA Ames Center. Chris worked as a senior staff engineer at Sun Microsystems for Project zembly, the cloud development and deployment environment as well as technical lead in many NetBeans projects. Chris is an author of the NetBeans Field Guide and Assemble the Social Web With Zembly.
Thomas Ng Software Engineer, AOL
Thomas Ng is a software engineer at AOL, building web services for the go90 mobile entertainment platform using Cassandra, Scala and Kafka.
How Netflix tests in production to augment more traditional testing methods. This talk covers the Simian Army (Chaos Monkey & friends, code coverage in production, and canary testing.
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus
Â
As part of the DOE Integrated Research Infrastructure (IRI) program, NERSC at Lawrence Berkeley National Lab and ALCF at Argonne National Lab are working closely with General Atomics on accelerating the computing requirements of the DIII-D experiment. As part of the work the team is investigating ways to speedup the time to solution for many different parts of the DIII-D workflow including how they run jobs on HPC systems. One of these routes is looking at Globus Compute as a way to replace the current method for managing tasks and we describe a brief proof of concept showing how Globus Compute could help to schedule jobs and be a tool to connect compute at different facilities.
Large Language Models and the End of ProgrammingMatt Welsh
Â
Talk by Matt Welsh at Craft Conference 2024 on the impact that Large Language Models will have on the future of software development. In this talk, I discuss the ways in which LLMs will impact the software industry, from replacing human software developers with AI, to replacing conventional software with models that perform reasoning, computation, and problem-solving.
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Globus
Â
The U.S. Geological Survey (USGS) has made substantial investments in meeting evolving scientific, technical, and policy driven demands on storing, managing, and delivering data. As these demands continue to grow in complexity and scale, the USGS must continue to explore innovative solutions to improve its management, curation, sharing, delivering, and preservation approaches for large-scale research data. Supporting these needs, the USGS has partnered with the University of Chicago-Globus to research and develop advanced repository components and workflows leveraging its current investment in Globus. The primary outcome of this partnership includes the development of a prototype enterprise repository, driven by USGS Data Release requirements, through exploration and implementation of the entire suite of the Globus platform offerings, including Globus Flow, Globus Auth, Globus Transfer, and Globus Search. This presentation will provide insights into this research partnership, introduce the unique requirements and challenges being addressed and provide relevant project progress.
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
Â
In this slide, we show the simulation example and the way to compile this solver.
In this solver, the Helmholtz equation can be solved by helmholtzFoam. Also, the Helmholtz equation with uniformly dispersed bubbles can be simulated by helmholtzBubbleFoam.
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
Â
Cross-facility research orchestration comes with ever-changing constraints regarding the availability and suitability of various compute and data resources. In short, a flexible data and processing fabric is needed to enable the dynamic redirection of data and compute tasks throughout the lifecycle of an experiment. In this talk, we illustrate how we easily leveraged Globus services to instrument the ACE research testbed at the Oak Ridge Leadership Computing Facility with flexible data and task orchestration capabilities.
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxrickgrimesss22
Â
Discover the essential features to incorporate in your Winzo clone app to boost business growth, enhance user engagement, and drive revenue. Learn how to create a compelling gaming experience that stands out in the competitive market.
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns
Â
Unlocking Business Potential: Tailored Technology Solutions by Prosigns
Discover how Prosigns, a leading technology solutions provider, partners with businesses to drive innovation and success. Our presentation showcases our comprehensive range of services, including custom software development, web and mobile app development, AI & ML solutions, blockchain integration, DevOps services, and Microsoft Dynamics 365 support.
Custom Software Development: Prosigns specializes in creating bespoke software solutions that cater to your unique business needs. Our team of experts works closely with you to understand your requirements and deliver tailor-made software that enhances efficiency and drives growth.
Web and Mobile App Development: From responsive websites to intuitive mobile applications, Prosigns develops cutting-edge solutions that engage users and deliver seamless experiences across devices.
AI & ML Solutions: Harnessing the power of Artificial Intelligence and Machine Learning, Prosigns provides smart solutions that automate processes, provide valuable insights, and drive informed decision-making.
Blockchain Integration: Prosigns offers comprehensive blockchain solutions, including development, integration, and consulting services, enabling businesses to leverage blockchain technology for enhanced security, transparency, and efficiency.
DevOps Services: Prosigns' DevOps services streamline development and operations processes, ensuring faster and more reliable software delivery through automation and continuous integration.
Microsoft Dynamics 365 Support: Prosigns provides comprehensive support and maintenance services for Microsoft Dynamics 365, ensuring your system is always up-to-date, secure, and running smoothly.
Learn how our collaborative approach and dedication to excellence help businesses achieve their goals and stay ahead in today's digital landscape. From concept to deployment, Prosigns is your trusted partner for transforming ideas into reality and unlocking the full potential of your business.
Join us on a journey of innovation and growth. Let's partner for success with Prosigns.
How to Position Your Globus Data Portal for Success Ten Good PracticesGlobus
Â
Science gateways allow science and engineering communities to access shared data, software, computing services, and instruments. Science gateways have gained a lot of traction in the last twenty years, as evidenced by projects such as the Science Gateways Community Institute (SGCI) and the Center of Excellence on Science Gateways (SGX3) in the US, The Australian Research Data Commons (ARDC) and its platforms in Australia, and the projects around Virtual Research Environments in Europe. A few mature frameworks have evolved with their different strengths and foci and have been taken up by a larger community such as the Globus Data Portal, Hubzero, Tapis, and Galaxy. However, even when gateways are built on successful frameworks, they continue to face the challenges of ongoing maintenance costs and how to meet the ever-expanding needs of the community they serve with enhanced features. It is not uncommon that gateways with compelling use cases are nonetheless unable to get past the prototype phase and become a full production service, or if they do, they don't survive more than a couple of years. While there is no guaranteed pathway to success, it seems likely that for any gateway there is a need for a strong community and/or solid funding streams to create and sustain its success. With over twenty years of examples to draw from, this presentation goes into detail for ten factors common to successful and enduring gateways that effectively serve as best practices for any new or developing gateway.
Software Engineering, Software Consulting, Tech Lead, Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Transaction, Spring MVC, OpenShift Cloud Platform, Kafka, REST, SOAP, LLD & HLD.
Navigating the Metaverse: A Journey into Virtual Evolution"Donna Lenk
Â
Join us for an exploration of the Metaverse's evolution, where innovation meets imagination. Discover new dimensions of virtual events, engage with thought-provoking discussions, and witness the transformative power of digital realms."
OpenMetadata Community Meeting - 5th June 2024OpenMetadata
Â
The OpenMetadata Community Meeting was held on June 5th, 2024. In this meeting, we discussed about the data quality capabilities that are integrated with the Incident Manager, providing a complete solution to handle your data observability needs. Watch the end-to-end demo of the data quality features.
* How to run your own data quality framework
* What is the performance impact of running data quality frameworks
* How to run the test cases in your own ETL pipelines
* How the Incident Manager is integrated
* Get notified with alerts when test cases fail
Watch the meeting recording here - https://www.youtube.com/watch?v=UbNOje0kf6E
2. @chbatey
Who am I?
⢠DataStax
- Technical Evangelist / Software Engineer
- Builds enterprise ready version of Apache
Cassandra
⢠Sky: Building next generation Internet TV
platform
⢠Lots of time working on a test double for
Apache Cassandra
3. @chbatey
Agenda
â˘Setting the scene
â˘What do we mean by a fault?
â˘What is a micro(ish)service?
â˘Monolith application vs the micro(ish)service
â˘A worked example
â˘Identify an issue
â˘Reproduce/test it
â˘Show how to deal with the issue
8. @chbatey
Time for an example...
â˘All examples are on github
â˘Technologies used:
â˘Dropwizard
â˘Spring Boot
â˘Wiremock
â˘Hystrix
â˘Graphite
â˘Saboteur
10. Isolated service tests
Movie service
Mocks
User
Device
Pin service
Play Movie
Acceptance
Test
Prime
Real HTTP/TCP
11. @chbatey
Fault tolerance
1.Donât take forever - Timeouts
2.Donât try if you canât succeed
3.Fail gracefully
4.Know if itâs your fault
5.Donât whack a dead horse
6.Turn broken stuff off
12. @chbatey
1 - Donât take forever
⢠If at first you donât succeed, donât take forever to tell someone
⢠Timeout and fail fast
19. @chbatey
Wiremock + Saboteur + Vagrant
â˘Vagrant - launches + provisions local VMs
â˘Saboteur - uses tc, iptables to simulate network issues
â˘Wiremock - used to mock HTTP dependencies
â˘Cucumber - acceptance tests
20. I can write an automated test for that?
Wiremock:
â˘User Service
â˘Device Service
â˘Pin Service
S
a
b
o
t
e
u
r
Vagrant + Virtual box VM
Movie
Service
Acceptance
Test
prime to drop trafďŹc
reset
23. A simple Spring RestController
@RestControllerâ¨
public class Resource {â¨
â¨
private static final Logger LOGGER = LoggerFactory.getLogger(Resource.class);â¨
â¨
@Autowiredâ¨
private ScaryDependency scaryDependency;â¨
â¨
@RequestMapping("/scary")â¨
public String callTheScaryDependency() {â¨
LOGGER.info("Resource later: I wonder which thread I am on!");â¨
return scaryDependency.getScaryString();â¨
}â¨
}
24. Scary dependency
@Componentâ¨
public class ScaryDependency {â¨
â¨
private static final Logger LOGGER = LoggerFactory.getLogger(ScaryDependency.class);â¨
â¨
public String getScaryString() {â¨
LOGGER.info("Scary Dependency: I wonder which thread I am on! Tomcats?â);â¨
if (System.currentTimeMillis() % 2 == 0) {â¨
return "Scary String";â¨
} else {
Thread.sleep(5000)â¨
return âSlow Scary String";â¨
}â¨
}â¨
}
25. All on the tomcat thread
13:47:20.200 [http-8080-exec-1] INFO info.batey.examples.Resource -
Resource later: I wonder which thread I am on!
13:47:20.200 [http-8080-exec-1] INFO info.batey.examples.ScaryDependency
- Scary Dependency: I wonder which thread I am on! Tomcats?
26. Scary dependency
@Componentâ¨
public class ScaryDependency {â¨
â¨
private static final Logger LOGGER = LoggerFactory.getLogger(ScaryDependency.class);â¨
â¨
@HystrixCommand()â¨
public String getScaryString() {â¨
LOGGER.info("Scary Dependency: I wonder which thread I am on! Tomcats?â);â¨
if (System.currentTimeMillis() % 2 == 0) {â¨
return "Scary String";â¨
} else {
Thread.sleep(5000)â¨
return âSlow Scary String";â¨
}â¨
}â¨
}
27. What an annotation can do...
13:51:21.513 [http-8080-exec-1] INFO info.batey.examples.Resource - Resource
later: I wonder which thread I am on!
13:51:21.614 [hystrix-ScaryDependency-1] INFO info.batey.examples.ScaryDependency
- Scary Dependency: I wonder which thread I am on! Tomcats? :P
28. @chbatey
Timeouts take home
â You canât use network level timeouts for SLAs
â Test your SLAs - if someone says you canât, hit them with a stick
â Scary things happen without network issues
29. @chbatey
Fault tolerance
1.Donât take forever - Timeouts
2.Donât try if you canât succeed
3.Fail gracefully
4.Know if itâs your fault
5.Donât whack a dead horse
6.Turn broken stuff off
34. @chbatey
Donât try if you canât succeed
⢠Executor Unbounded queues :(
⢠newFixedThreadPool
⢠newSingleThreadExecutor
⢠newThreadCachedThreadPool
⢠Bound your queues and threads
⢠Fail quickly when the queue / maxPoolSize is met
⢠Know your drivers
35. @chbatey
This is a functional requirement
â˘Set the timeout very high
â˘Use Wiremock to add a large delay to the requests
36. @chbatey
This is a functional requirement
â˘Set the timeout very high
â˘Use Wiremock to add a large delay to the requests
â˘Set queue size and thread pool size to 1
â˘Send in 2 requests to use the thread and fill the queue
â˘What happens on the 3rd request?
37. @chbatey
Fault tolerance
1.Donât take forever - Timeouts
2.Donât try if you canât succeed
3.Fail gracefully
4.Know if itâs your fault
5.Donât whack a dead horse
6.Turn broken stuff off
42. @chbatey
Fault tolerance
1.Donât take forever - Timeouts
2.Donât try if you canât succeed
3.Fail gracefully
4.Know if itâs your fault
5.Donât whack a dead horse
6.Turn broken stuff off
47. @chbatey
Separate resource pools
â˘Donât flood your dependencies
â˘Be able to answer the questions:
-How many connections will you
make to dependency X?
-Are you getting close to your max
connections?
48. So easy with Dropwizard + Hystrix
metrics:â¨
reporters:â¨
- type: graphiteâ¨
host: 192.168.10.120â¨
port: 2003â¨
preďŹx: shiny_app
@Overrideâ¨
public void initialize(Bootstrap<AppConfig> appConfigBootstrap) {â¨
HystrixCodaHaleMetricsPublisher metricsPublisher = â¨
new HystrixCodaHaleMetricsPublisher(appConfigBootstrap.getMetricRegistry());â¨
HystrixPlugins.getInstance().registerMetricsPublisher(metricsPublisher);â¨
}
49. @chbatey
Fault tolerance
1.Donât take forever - Timeouts
2.Donât try if you canât succeed
3.Fail gracefully
4.Know if itâs your fault
5.Donât whack a dead horse
6.Turn broken stuff off
53. Implementation with Hystrix
â¨
@Path("integrate")â¨
public class IntegrationResource {â¨
â¨
private static final Logger LOGGER = LoggerFactory.getLogger(IntegrationResource.class);â¨
â¨
@GETâ¨
@Timedâ¨
public String integrate() {â¨
LOGGER.info("integrate");â¨
String user = new UserServiceDependency(userService).execute();â¨
String device = new DeviceServiceDependency(deviceService).execute();â¨
Boolean pinCheck = new PinCheckDependency(pinService).execute();â¨
return String.format("[User info: %s] n[Device info: %s] n[Pin check: %s] n", user, device, pinCheck);â¨
}â¨
â¨
}
54. Implementation with Hystrix
â¨
public class PinCheckDependency extends HystrixCommand<Boolean> {â¨
â¨
private HttpClient httpClient;â¨
â¨
public PinCheckDependency(HttpClient httpClient) {â¨
super(HystrixCommandGroupKey.Factory.asKey("PinCheckService"));â¨
this.httpClient = httpClient;â¨
}â¨
â¨
@Overrideâ¨
protected Boolean run() throws Exception {â¨
HttpGet pinCheck = new HttpGet("http://localhost:9090/pincheck");â¨
HttpResponse pinCheckResponse = httpClient.execute(pinCheck);â¨
int statusCode = pinCheckResponse.getStatusLine().getStatusCode();â¨
if (statusCode != 200) {â¨
throw new RuntimeException("Oh dear no pin check, status code " + statusCode);â¨
}â¨
String pinCheckInfo = EntityUtils.toString(pinCheckResponse.getEntity());â¨
return Boolean.valueOf(pinCheckInfo);â¨
}â¨
â¨
}â¨
55. Implementation with Hystrix
â¨
public class PinCheckDependency extends HystrixCommand<Boolean> {â¨
â¨
private HttpClient httpClient;â¨
â¨
public PinCheckDependency(HttpClient httpClient) {â¨
super(HystrixCommandGroupKey.Factory.asKey("PinCheckService"));â¨
this.httpClient = httpClient;â¨
}â¨
â¨
@Overrideâ¨
protected Boolean run() throws Exception {â¨
HttpGet pinCheck = new HttpGet("http://localhost:9090/pincheck");â¨
HttpResponse pinCheckResponse = httpClient.execute(pinCheck);â¨
int statusCode = pinCheckResponse.getStatusLine().getStatusCode();â¨
if (statusCode != 200) {â¨
throw new RuntimeException("Oh dear no pin check, status code " + statusCode);â¨
}â¨
String pinCheckInfo = EntityUtils.toString(pinCheckResponse.getEntity());â¨
return Boolean.valueOf(pinCheckInfo);â¨
}â¨
â¨
@Overrideâ¨
public Boolean getFallback() {â¨
return true;â¨
}â¨
}â¨
56. @chbatey
Triggering the fallback
â˘Error threshold percentage
â˘Bucket of time for the percentage
â˘Minimum number of requests to trigger
â˘Time before trying a request again
â˘Disable
â˘Per instance statistics
57. @chbatey
Fault tolerance
1.Donât take forever - Timeouts
2.Donât try if you canât succeed
3.Fail gracefully
4.Know if itâs your fault
5.Donât whack a dead horse
6.Turn broken stuff off
59. @chbatey
To recap
1.Donât take forever - Timeouts
2.Donât try if you canât succeed
3.Fail gracefully
4.Know if itâs your fault
5.Donât whack a dead horse
6.Turn broken stuff off
65. @chbatey
How to test metric publishing?
â Stub out graphite and verify calls?
â Programmatically call graphite and verify numbers?
â Make metrics + logs part of the story demo