Git Product home page Git Product logo

finagle-aws's Introduction

#finagle-aws

A module for making life a little easier when talking to AWS via Finagle.

   import com.heroku.finagle.aws.S3.{S3Secret, S3Key}
   import com.heroku.finagle.aws.{Get, Put, S3}
   import com.twitter.util.Future
   import org.jboss.netty.buffer.ChannelBuffers
   import org.jboss.netty.handler.codec.http.HttpResponse
   import org.jboss.netty.util.CharsetUtil

   class Readme {

     val s3key = S3Key("...")

     val s3Secret = S3Secret("...")

     val client = S3.client(s3key, s3Secret)

     val buffer = ChannelBuffers.wrappedBuffer("SOME BYTES".getBytes(CharsetUtil.UTF_8))

     val put: Future[HttpResponse] = client(Put("theBucket", "objectName", buffer))

     val get: Future[HttpResponse] = client(Get("theBucket", "objectName"))


   }

##License

Copyright 2001-2012 Scott Clasen <[email protected]>

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.

finagle-aws's People

Contributors

matterkkila avatar ryanbrainard avatar sclasen avatar sobrn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

finagle-aws's Issues

Please make this work again!

This is a great idea, and I need exactly this!

Required work: port to Scala 2.11 and then to the latest Finagle.

finagle-aws client does not follow redirects

In using finagle-aws, I ran into an issue when trying to PUT and GET from S3, and S3 itself was responding with HTTP 307, redirecting me to a different URL to PUT or GET the object - a URL with a specific zone.

Considering the actual Finagle client is constructed within the S3.client function, it isn't currently configured to follow redirects, nor is it possible to create a new finagle-aws client to deliver or retrieve the object from the location advised in the redirect.

I've worked around this by creating my own Service[S3Request, HTTPResponse] client, roughly based on the following pseudocode:

let o = my object to save to S3
let c = new Finagle Service[S3Request, HTTPResponse] client pointing to s3.amazonaws.com
let resp = call c with PUT for o
if resp.statusCode == 307, let c = new Finagle client pointing to Location header, repeat call to PUT
else success

Apart from this, using the rest of the library works well, and interacts fine with a manually created Service[S3Request, HTTPResponse] object.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.