Skip to content

Commit

Permalink
database enable the 'other' compression parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed May 10, 2008
1 parent c731f2d commit 367adab
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 9 deletions.
Expand Up @@ -45,7 +45,8 @@ public class ParameterConstants {
public final static String DATA_LOADER_TIME_BETWEEN_ACK_RETRIES = "symmetric.runtime.time.between.ack.retries.ms";

public final static String TRANSPORT_HTTP_TIMEOUT = "symmetric.runtime.http.timeout.ms";
public final static String TRANSPORT_HTTP_USE_COMPRESSION = "symmetric.runtime.http.compression";
public final static String TRANSPORT_HTTP_USE_COMPRESSION_CLIENT = "symmetric.runtime.http.compression";
public final static String TRANSPORT_HTTP_COMPRESSION_DISABLED_SERVLET = "symmetric.web.compression.disabled";

public final static String DBPOOL_URL = "db.url";
public final static String DBPOOL_DRIVER ="db.driver";
Expand Down
Expand Up @@ -110,7 +110,7 @@ public IIncomingTransport getPullTransport(Node remote, Node local) throws IOExc
public IOutgoingWithResponseTransport getPushTransport(Node remote, Node local) throws IOException {
URL url = new URL(buildURL("push", remote, local));
int httpTimeout = parameterService.getInt(ParameterConstants.TRANSPORT_HTTP_TIMEOUT);
boolean useCompression = parameterService.is(ParameterConstants.TRANSPORT_HTTP_USE_COMPRESSION);
boolean useCompression = parameterService.is(ParameterConstants.TRANSPORT_HTTP_USE_COMPRESSION_CLIENT);
return new HttpOutgoingTransport(url, httpTimeout, useCompression);
}

Expand Down
Expand Up @@ -30,6 +30,7 @@

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jumpmind.symmetric.common.ParameterConstants;

/**
*
Expand Down Expand Up @@ -89,6 +90,11 @@ public void init(final FilterConfig filterConfig) throws ServletException {

delegate.init(filterConfig);
}

@Override
public boolean isDisabled() {
return parameterService.is(ParameterConstants.TRANSPORT_HTTP_COMPRESSION_DISABLED_SERVLET);
}

@Override
protected Log getLogger()
Expand Down
Expand Up @@ -34,6 +34,7 @@

import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.jumpmind.symmetric.service.IParameterService;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

Expand All @@ -48,6 +49,7 @@ public class ServletResourceTemplate implements IServletResource {
protected String[] uriPatterns;
private String[] regexPatterns;
protected Pattern[] compiledRegexPatterns;
protected IParameterService parameterService;

public void init(ServletContext servletContext) {
this.servletContext = servletContext;
Expand Down Expand Up @@ -259,4 +261,8 @@ protected void setServletContext(ServletContext servletContext)
{
this.servletContext = servletContext;
}

public void setParameterService(IParameterService parameterService) {
this.parameterService = parameterService;
}
}
9 changes: 5 additions & 4 deletions symmetric/src/main/resources/symmetric-default.properties
Expand Up @@ -165,6 +165,10 @@ symmetric.runtime.http.timeout.ms=600000
# This property is override-able in the database.
symmetric.runtime.http.compression=true

# Disable compression from occurring on Servlet communication. This property only
# affects the outbound HTTP traffic streamed by the PullServlet and PushServlet.
symmetric.web.compression.disabled=true

# When starting jobs, symmetric attempts to randomize the start time to spread out load. This is the
# maximum wait period before starting a job.
symmetric.runtime.job.random.max.start.time.ms=10000
Expand Down Expand Up @@ -216,7 +220,4 @@ symmetric.transport.type=http

# If using the HsqlDbDialect, this property indicates whether Symmetric should setup the embedded database properties or if an
# external application will be doing so.
symmetric.hsqldb.initialize.db=true

# Disable compression from occurring on Servlet communication
symmetric.web.compression.disabled=true
symmetric.hsqldb.initialize.db=true
5 changes: 2 additions & 3 deletions symmetric/src/main/resources/symmetric-web.xml
Expand Up @@ -70,9 +70,8 @@
<value>/push/*</value>
<value>/registration/*</value>
</list>
</property>
<property name="disabled"
value="${symmetric.web.compression.disabled}" />
</property>
<property name="parameterService" ref="parameterService" />
</bean>

<bean id="throttleFilter"
Expand Down

0 comments on commit 367adab

Please sign in to comment.