Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-cloud-netflix
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-cloud-netflix
Commits
869e3ec9
Commit
869e3ec9
authored
Mar 19, 2015
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upgrade to feign 8.1.0
removes ugly dagger dependency fixes gh-183
parent
edbb0acc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
26 deletions
+14
-26
pom.xml
pom.xml
+1
-7
pom.xml
spring-cloud-netflix-core/pom.xml
+0
-5
SpringDecoder.java
...gframework/cloud/netflix/feign/support/SpringDecoder.java
+5
-6
SpringEncoder.java
...gframework/cloud/netflix/feign/support/SpringEncoder.java
+8
-8
No files found.
pom.xml
View file @
869e3ec9
...
...
@@ -24,7 +24,7 @@
<main.basedir>
${basedir}
</main.basedir>
<archaius.version>
0.6.5
</archaius.version>
<eureka.version>
1.1.147
</eureka.version>
<feign.version>
7.3
.0
</feign.version>
<feign.version>
8.1
.0
</feign.version>
<hystrix.version>
1.4.0
</hystrix.version>
<ribbon.version>
2.0.0
</ribbon.version>
<zuul.version>
1.0.28
</zuul.version>
...
...
@@ -186,12 +186,6 @@
</exclusion>
</exclusions>
</dependency>
<!-- TODO: remove with feign 8.0.0 -->
<dependency>
<groupId>
com.squareup.dagger
</groupId>
<artifactId>
dagger
</artifactId>
<version>
1.2.2
</version>
</dependency>
<dependency>
<groupId>
com.netflix.feign
</groupId>
<artifactId>
feign-slf4j
</artifactId>
...
...
spring-cloud-netflix-core/pom.xml
View file @
869e3ec9
...
...
@@ -87,11 +87,6 @@
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
com.squareup.dagger
</groupId>
<artifactId>
dagger
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
com.netflix.hystrix
</groupId>
<artifactId>
hystrix-core
</artifactId>
<optional>
true
</optional>
...
...
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/support/SpringDecoder.java
View file @
869e3ec9
...
...
@@ -16,13 +16,14 @@
package
org
.
springframework
.
cloud
.
netflix
.
feign
.
support
;
import
static
org
.
springframework
.
cloud
.
netflix
.
feign
.
support
.
FeignUtils
.
getHttpHeaders
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.lang.reflect.ParameterizedType
;
import
java.lang.reflect.Type
;
import
javax.inject.Provider
;
import
org.springframework.beans.factory.ObjectFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.web.HttpMessageConverters
;
import
org.springframework.http.HttpHeaders
;
...
...
@@ -30,8 +31,6 @@ import org.springframework.http.HttpStatus;
import
org.springframework.http.client.ClientHttpResponse
;
import
org.springframework.web.client.HttpMessageConverterExtractor
;
import
static
org
.
springframework
.
cloud
.
netflix
.
feign
.
support
.
FeignUtils
.
getHttpHeaders
;
import
feign.FeignException
;
import
feign.Response
;
import
feign.codec.DecodeException
;
...
...
@@ -43,7 +42,7 @@ import feign.codec.Decoder;
public
class
SpringDecoder
implements
Decoder
{
@Autowired
private
Provider
<
HttpMessageConverters
>
messageConverters
;
private
ObjectFactory
<
HttpMessageConverters
>
messageConverters
;
public
SpringDecoder
()
{
}
...
...
@@ -54,7 +53,7 @@ public class SpringDecoder implements Decoder {
if
(
type
instanceof
Class
||
type
instanceof
ParameterizedType
)
{
@SuppressWarnings
({
"unchecked"
,
"rawtypes"
})
HttpMessageConverterExtractor
<?>
extractor
=
new
HttpMessageConverterExtractor
(
type
,
this
.
messageConverters
.
get
().
getConverters
());
type
,
this
.
messageConverters
.
get
Object
().
getConverters
());
return
extractor
.
extractData
(
new
FeignResponseAdapter
(
response
));
}
...
...
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/support/SpringEncoder.java
View file @
869e3ec9
...
...
@@ -16,16 +16,18 @@
package
org
.
springframework
.
cloud
.
netflix
.
feign
.
support
;
import
static
org
.
springframework
.
cloud
.
netflix
.
feign
.
support
.
FeignUtils
.
getHttpHeaders
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.lang.reflect.Type
;
import
java.nio.charset.Charset
;
import
java.util.Collection
;
import
javax.inject.Provider
;
import
lombok.extern.apachecommons.CommonsLog
;
import
org.springframework.beans.factory.ObjectFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.web.HttpMessageConverters
;
import
org.springframework.http.HttpHeaders
;
...
...
@@ -37,8 +39,6 @@ import feign.RequestTemplate;
import
feign.codec.EncodeException
;
import
feign.codec.Encoder
;
import
static
org
.
springframework
.
cloud
.
netflix
.
feign
.
support
.
FeignUtils
.
getHttpHeaders
;
/**
* @author Spencer Gibb
*/
...
...
@@ -46,10 +46,10 @@ import static org.springframework.cloud.netflix.feign.support.FeignUtils.getHttp
public
class
SpringEncoder
implements
Encoder
{
@Autowired
private
Provider
<
HttpMessageConverters
>
messageConverters
;
private
ObjectFactory
<
HttpMessageConverters
>
messageConverters
;
@Override
public
void
encode
(
Object
requestBody
,
RequestTemplate
request
)
public
void
encode
(
Object
requestBody
,
Type
bodyType
,
RequestTemplate
request
)
throws
EncodeException
{
// template.body(conversionService.convert(object, String.class));
if
(
requestBody
!=
null
)
{
...
...
@@ -62,8 +62,8 @@ public class SpringEncoder implements Encoder {
requestContentType
=
MediaType
.
valueOf
(
type
);
}
for
(
HttpMessageConverter
<?>
messageConverter
:
this
.
messageConverters
.
get
()
.
getConverters
())
{
for
(
HttpMessageConverter
<?>
messageConverter
:
this
.
messageConverters
.
get
Object
().
get
Converters
())
{
if
(
messageConverter
.
canWrite
(
requestType
,
requestContentType
))
{
if
(
log
.
isDebugEnabled
())
{
if
(
requestContentType
!=
null
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment