Tag Archives: Netflix

Rest client calls with Spring Cloud


via all and sundry: Rest client calls with Spring Cloud.

There are a few interesting ways to make REST client calls with the Spring-Cloud project.
Spring-Cloud rest support builds on top of the core Netflix OSS libraries, but abstracts them and in the process simplifies using the libraries.

Video: Scaling A/B testing on Netflix.com witn Node.js


Netflix’s Hystrix latency and fault tolerance library, for Go


hystrix change Runner interface to allow user-defined methods to use simple r… 8 months ago
scripts simply vagrant provisioning 8 months ago
.gitignore vagrant with go 11 months ago
.travis.yml disable race checker. failing on travis with: 11 months ago
LICENSE Initial commit 11 months ago
README.md change Runner interface to allow user-defined methods to use simple r… 8 months ago
Vagrantfile simply vagrant provisioning 8 months ago

Hystrix is a great project from Netflix.

Hystrix is a latency and fault tolerance library designed to isolate points of access to remote systems, services and 3rd party libraries, stop cascading failure and enable resilience in complex distributed systems where failure is inevitable.

I think the Hystrix patterns of programmer-defined fallbacks and adaptive health monitoring are good for any distributed system. Go routines and channels are great concurrency primitives, but don’t directly help our application stay available during failures.

hystrix-go aims to allow Go programmers to easily build applications with similar execution semantics of the Java-based Hystrix library.

For more about how Hystrix works, refer to the Java Hystrix wiki

How to use

import "github.com/afex/hystrix-go/hystrix"

Define your struct with basic settings

type MyCommand struct{}

func (c *MyCommand) PoolName() string {
    return "MyCommand"
}

func (c *MyCommand) Timeout() time.Duration {
    return time.Millisecond * 100
}

Implement Run and Fallback methods

Define your application logic which relies on external systems. When that system is healthy this will be the only thing which executes.

func (c *MyCommand) Run() (interface{}, error) {
    // example: load the friends list from an external service, and return the count
    response, err := http.Get("http://service/friend_list")
    count := // snip: parse response count friends 
    if err != nil {
        return nil, err
    } else {
        return count, nil
    }
}

Define your fallback behavior. Ideally, the logic here will allow your application to gracefully handle theRun() method being unavailable.

This triggers when your Run() method returns an error, or whenever it is unable to complete based on avariety of health checks.

func (c *MyCommand) Fallback(err error) (interface{}, error) {
    // example: when friends service is slow or unavailable, act as though the user has no friends.
    return 0, nil
}

Synchronous execution

Start a command, and wait for it to finish.

command := hystrix.NewCommand(&MyCommand{})
result, err := command.Execute()

Asynchronous execution

Start a command, and receive channels to grab the response or error later.

command := hystrix.NewCommand(&MyCommand{})
results, errors := command.Queue()
select {
case result := <-results:
case err := <-errors:
}

Build and Test

  • Install vagrant and VirtualBox
  • Clone the hystrix-go repository
  • Inside the hystrix-go directory, run vagrant up, then vagrant ssh
  • cd /go/src/github.com/afex/hystrix-go
  • go test ./...

Message Security Layer


.idea Add IntelliJ IDEA project files. 3 months ago
.settings Merge branch ‘BurpExtender’ 11 days ago
src Fixing bug in MslControl.js, SynchronizedClock#getTime. Now using thi… 2 days ago
.classpath Remove duplicate examples build path from Eclipse project. 8 days ago
.gitignore Add test-output to .gitignore. 12 days ago
.project Add Gradle build files and Eclipse Gradle integration. 20 days ago
README.md Add mention of external review. 23 hours ago
build.gradle Burp example requires the test classes to compile. 8 days ago
findbugs-exclude.xml Exclude charset findbugs from Burp code; there is no way to extract t… 8 days ago
java2js_regexes.rtf Initial commit of Java and JavaScript MSL stacks and unit tests. 4 months ago
msl.iml Integration Tests 18 days ago
overview-public.html Point Javadoc overview HTML to GitHub documentation. a month ago
overview.html Point Javadoc overview HTML to GitHub documentation. a month ago
settings.gradle Add Gradle build files and Eclipse Gradle integration. 20 days ago

Message Security Layer (MSL) is an extensible and flexible secure messaging protocol that can be used to transport data between two or more communicating entities. Data may also be associated with specific users, and treated as confidential or non-replayable if so desired.

Documentation

The MSL Protocol provides a complete description of the protocol and implementation requirements. TheConfiguration Guide presents some common client and server MSL configurations. The protocol and configuration guide were reviewed by an external security firm. No issues were identified.

The set of public interfaces and classes an application must implement and use is documented in thePublic Javadoc. Documentation on all of the code, including internal classes and private methods, can be found in the full Javadoc.

For questions and support please contact Wesley Miaw directly. Bugs and feature requests should be filed in the Issue Tracker.

Third-Party Libraries

The Java MSL code base requires the org.json and Bouncy Castle libraries. The unit tests require JUnit 4and the integration tests require TestNG.

The JavaScript MSL code base includes some third-party libraries within the lib/ directory, most notably the Clarinet parser. The jsrsasign and crypto-js libraries are currently included but are planned for removal.

All third-party libraries are subject to their respective license agreements.

Getting Started

To build an application that uses MSL for communication, you must read through and understand the MSL Protocol. This is necessary because unlike other security protocols and libraries, you must make choices about how to secure your communication and authenticate your entities and users. The Configuration Guide can help you make those decisions.

The application interface to the MSL stack is MslControl. The application configuration for a single MSL network is an instance of MslContext. Your application may participate in multiple MSL networks and therefore have multiple instances of MslContext but only one MslControl should be used. Message-specific configuration, such as the user or security properties of that message, are specified in individual instances of MessageContext.

Java

The Java MSL code base includes project files for Eclipse and IntelliJ IDEA.

An example server is provided under src/examples/java/server/. The Eclipse project is a web project that can be deployed onto a Tomcat server. The example server is a J2EE servlet that will respond to requests from the example JavaScript client. The example server MSL configuration is specific to this server and should not be used to configure your application, but it can be used as the basis for doing so.

You may need to install the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files to use cryptographic keys above a certain size.

JavaScript

The JavaScript MSL code base assumes a JavaScript execution environment that supports the latestWeb Crypto API specification. If you are using a web browser you may need to enable experimental features or feature flags to enable Web Crypto.

  • Chrome Browser 37+
    For earlier versions: chrome://flags/#enable-experimental-web-platform-features
    On Linux libnss 3.16.2+ must be separately installed.
  • Firefox 34+
    For earlier versions: about:config dom.webcrypto.enabled
  • Internet Explorer 11+
  • Safari 8+

Your browser may not support all Web Crypto API algorithms, key sizes, and features. If you encounter a problem with a Web Crypto operation please check the release notes for your browser version to determine if it supports what you are trying to do.

To include the JavaScript MSL stack in your JavaScript application you must include all of the MSL JavaScript source files required by your MSL configuration. An example list of the required source files can be found in src/test/javascript/msltests.html.

An example client is provided under src/examples/javascript/client/. The example client is a web page that will send requests to the example Java server. The example client MSL configuration is specific to this client and should not be used to configure your appplication, but it can be used as the basis for doing so.

LICENSE

Copyright 2014 Netflix, Inc.

Licensed 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.

Video: Asynchronous Programming at Netflix


What’s does a mouse drag event have in common with an array of numbers? The answer to this question may surprise you: they are both collections. This key insight holds the key to dramatically simplifying asynchronous programming in JavaScript. In this talk you will learn how you can use the familiar JavaScript Array methods to create surprisingly expressive asynchronous programs.

Senior Java QM Engineer at Beaverton, OR


Role: Senior Java QM Engineer
Location: Beaverton, OR

Note: Interested candidates can send me your updated resume at kdinesh@prokarma.com or reach me at (402) 905 9212. Please share or like this post.

What You Need for this Position
• Strong communication skills.
• Experience developing automated integration and performance tests.
• Strong (demonstrable) knowledge and hands-on experience with Java.
• Demonstrable knowledge of at least one scripting language such as JavaScript, Python, Bash, etc…
• Experience with Linux (CentOS, Ubuntu, etc).
• Experience developing in a continuous integration environment using Jenkins or similar CI frameworks.

Preferred if you have the following:
• Experience maintaining gradle builds.
• Experience using NoSQL databases such as Cassandra, Mongo or Couchbase.
• Experience with Netflix OSS technologies.
• Experience integrating with or utilizing production monitoring technologies such as New Relic or Splunk.