Skip to content

Commit

Permalink
Merge pull request #193 from shiyindaxiaojie/feature
Browse files Browse the repository at this point in the history
fixed curator version
  • Loading branch information
shiyindaxiaojie authored Sep 6, 2023
2 parents 679fa93 + 75287bd commit d5e86cd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion eden-components/eden-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
<dubbo.version>3.2.1</dubbo.version>
<protobuf.version>4.0.0-rc-2</protobuf.version>
<zookeeper.version>3.7.0</zookeeper.version>
<curator.version>5.1.0</curator.version>
<curator.version>4.3.0</curator.version>
<zkclient.version>0.1</zkclient.version>
<xxl-job.version>2.4.0</xxl-job.version>
<grpc.version>1.57.2</grpc.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-common</artifactId>
</exclusion>
<exclusion>
<artifactId>simpleclient_common</artifactId>
<groupId>io.prometheus</groupId>
</exclusion>
</exclusions>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.BlockExceptionHandler;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.http.MediaType;
import org.ylzl.eden.spring.framework.json.support.JSONHelper;
import lombok.extern.slf4j.Slf4j;
import org.ylzl.eden.spring.framework.web.util.ServletUtils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
Expand All @@ -30,12 +30,14 @@
* @author <a href="mailto:[email protected]">gyl</a>
* @since 2.4.13
*/
@Slf4j
public class CustomBlockExceptionHandler implements BlockExceptionHandler {

@Override
public void handle(HttpServletRequest request, HttpServletResponse response, BlockException e) throws Exception {
Object body = BlockResponseBuilder.buildResponse(e);
response.setContentType(MediaType.APPLICATION_JSON_UTF8_VALUE);
response.getWriter().write(JSONHelper.json().toJSONString(body));
String body = BlockResponseBuilder.buildResponse(e).toString();
log.debug("Trigger sentinel block response: {}", body);
response.setContentType(ServletUtils.APPLICATION_JSON_UTF8_VALUE);
response.getWriter().write(body);
}
}

0 comments on commit d5e86cd

Please sign in to comment.