@@ -109,54 +109,40 @@ protected Map<String, Object> extractStandardHeaders(MessageProperties amqpMessa
109
109
Map <String , Object > headers = new HashMap <String , Object >();
110
110
try {
111
111
JavaUtils .INSTANCE
112
- .acceptIfNotNull (AmqpHeaders .APP_ID , amqpMessageProperties .getAppId (),
113
- (key , value ) -> headers .put (key , value ))
114
- .acceptIfNotNull (AmqpHeaders .CLUSTER_ID , amqpMessageProperties .getClusterId (),
115
- (key , value ) -> headers .put (key , value ))
112
+ .acceptIfNotNull (AmqpHeaders .APP_ID , amqpMessageProperties .getAppId (), headers ::put )
113
+ .acceptIfNotNull (AmqpHeaders .CLUSTER_ID , amqpMessageProperties .getClusterId (), headers ::put )
116
114
.acceptIfNotNull (AmqpHeaders .CONTENT_ENCODING , amqpMessageProperties .getContentEncoding (),
117
- ( key , value ) -> headers . put ( key , value ) );
115
+ headers :: put );
118
116
long contentLength = amqpMessageProperties .getContentLength ();
119
117
JavaUtils .INSTANCE
120
- .acceptIfCondition (contentLength > 0 , AmqpHeaders .CONTENT_LENGTH , contentLength ,
121
- (key , value ) -> headers .put (key , value ))
122
- .acceptIfHasText (AmqpHeaders .CONTENT_TYPE , amqpMessageProperties .getContentType (),
123
- (key , value ) -> headers .put (key , value ))
124
- .acceptIfHasText (AmqpHeaders .CORRELATION_ID , amqpMessageProperties .getCorrelationId (),
125
- (key , value ) -> headers .put (key , value ))
118
+ .acceptIfCondition (contentLength > 0 , AmqpHeaders .CONTENT_LENGTH , contentLength , headers ::put )
119
+ .acceptIfHasText (AmqpHeaders .CONTENT_TYPE , amqpMessageProperties .getContentType (), headers ::put )
120
+ .acceptIfHasText (AmqpHeaders .CORRELATION_ID , amqpMessageProperties .getCorrelationId (), headers ::put )
126
121
.acceptIfNotNull (AmqpHeaders .RECEIVED_DELIVERY_MODE , amqpMessageProperties .getReceivedDeliveryMode (),
127
- ( key , value ) -> headers . put ( key , value ) );
122
+ headers :: put );
128
123
long deliveryTag = amqpMessageProperties .getDeliveryTag ();
129
124
JavaUtils .INSTANCE
130
- .acceptIfCondition (deliveryTag > 0 , AmqpHeaders .DELIVERY_TAG , deliveryTag ,
131
- (key , value ) -> headers .put (key , value ))
132
- .acceptIfHasText (AmqpHeaders .EXPIRATION , amqpMessageProperties .getExpiration (),
133
- (key , value ) -> headers .put (key , value ));
125
+ .acceptIfCondition (deliveryTag > 0 , AmqpHeaders .DELIVERY_TAG , deliveryTag , headers ::put )
126
+ .acceptIfHasText (AmqpHeaders .EXPIRATION , amqpMessageProperties .getExpiration (), headers ::put );
134
127
Integer messageCount = amqpMessageProperties .getMessageCount ();
135
128
JavaUtils .INSTANCE
136
129
.acceptIfCondition (messageCount != null && messageCount > 0 , AmqpHeaders .MESSAGE_COUNT , messageCount ,
137
- (key , value ) -> headers .put (key , value ))
138
- .acceptIfHasText (AmqpHeaders .MESSAGE_ID , amqpMessageProperties .getMessageId (),
139
- (key , value ) -> headers .put (key , value ));
130
+ headers ::put )
131
+ .acceptIfHasText (AmqpHeaders .MESSAGE_ID , amqpMessageProperties .getMessageId (), headers ::put );
140
132
Integer priority = amqpMessageProperties .getPriority ();
141
133
JavaUtils .INSTANCE
142
134
.acceptIfCondition (priority != null && priority > 0 , IntegrationMessageHeaderAccessor .PRIORITY ,
143
135
priority , (key , value ) -> headers .put (key , value ))
144
- .acceptIfNotNull (AmqpHeaders .RECEIVED_DELAY , amqpMessageProperties .getReceivedDelay (),
145
- (key , value ) -> headers .put (key , value ))
136
+ .acceptIfNotNull (AmqpHeaders .RECEIVED_DELAY , amqpMessageProperties .getReceivedDelay (), headers ::put )
146
137
.acceptIfNotNull (AmqpHeaders .RECEIVED_EXCHANGE , amqpMessageProperties .getReceivedExchange (),
147
- ( key , value ) -> headers . put ( key , value ) )
138
+ headers :: put )
148
139
.acceptIfHasText (AmqpHeaders .RECEIVED_ROUTING_KEY , amqpMessageProperties .getReceivedRoutingKey (),
149
- (key , value ) -> headers .put (key , value ))
150
- .acceptIfNotNull (AmqpHeaders .REDELIVERED , amqpMessageProperties .isRedelivered (),
151
- (key , value ) -> headers .put (key , value ))
152
- .acceptIfNotNull (AmqpHeaders .REPLY_TO , amqpMessageProperties .getReplyTo (),
153
- (key , value ) -> headers .put (key , value ))
154
- .acceptIfNotNull (AmqpHeaders .TIMESTAMP , amqpMessageProperties .getTimestamp (),
155
- (key , value ) -> headers .put (key , value ))
156
- .acceptIfHasText (AmqpHeaders .TYPE , amqpMessageProperties .getType (),
157
- (key , value ) -> headers .put (key , value ))
158
- .acceptIfHasText (AmqpHeaders .RECEIVED_USER_ID , amqpMessageProperties .getReceivedUserId (),
159
- (key , value ) -> headers .put (key , value ));
140
+ headers ::put )
141
+ .acceptIfNotNull (AmqpHeaders .REDELIVERED , amqpMessageProperties .isRedelivered (), headers ::put )
142
+ .acceptIfNotNull (AmqpHeaders .REPLY_TO , amqpMessageProperties .getReplyTo (), headers ::put )
143
+ .acceptIfNotNull (AmqpHeaders .TIMESTAMP , amqpMessageProperties .getTimestamp (), headers ::put )
144
+ .acceptIfHasText (AmqpHeaders .TYPE , amqpMessageProperties .getType (), headers ::put )
145
+ .acceptIfHasText (AmqpHeaders .RECEIVED_USER_ID , amqpMessageProperties .getReceivedUserId (), headers ::put );
160
146
161
147
for (String jsonHeader : JsonHeaders .HEADERS ) {
162
148
Object value = amqpMessageProperties .getHeaders ().get (jsonHeader .replaceFirst (JsonHeaders .PREFIX , "" ));
0 commit comments