[jboss-jira] [JBoss JIRA] (AS7-5321) support expressions for remote-destination-outbound-socket-binding host attrib
Kabir Khan (JIRA)
jira-events at lists.jboss.org
Sat Jan 5 18:53:08 EST 2013
[ https://issues.jboss.org/browse/AS7-5321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12743647#comment-12743647 ]
Kabir Khan commented on AS7-5321:
---------------------------------
https://github.com/kabir/jboss-as/commits/more-tests-socket-binding-group contains the reworked test.
To verify that it works at runtime, I checked that 7.1.2 and 7.1.3 both start up with standalone-ha.xml modified to contain the following socket-binding-group. I tried with both local-destination and remote-destination uncommented:
{code}
<socket-binding-group name="standard-sockets" default-interface="${xx:public}" port-offset="${jboss.socket.binding.port-offset:0}">
<socket-binding name="management-native" interface="${xx:management}" port="${jboss.management.native.port:9999}"/>
<socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
<socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>
<socket-binding name="ajp" port="8009"/>
<socket-binding name="http" port="8080"/>
<socket-binding name="https" port="8443"/>
<socket-binding name="jgroups-mping" port="0" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="${xx:45700}"/>
<socket-binding name="jgroups-tcp" port="7600"/>
<socket-binding name="jgroups-tcp-fd" port="57600"/>
<socket-binding name="jgroups-udp" port="55200" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45688"/>
<socket-binding name="jgroups-udp-fd" port="54200"/>
<socket-binding name="modcluster" port="0" multicast-address="224.0.1.105" multicast-port="23364"/>
<socket-binding name="osgi-http" interface="management" port="8090"/>
<socket-binding name="remoting" port="4447"/>
<socket-binding name="txn-recovery-environment" port="4712"/>
<socket-binding name="txn-status-manager" port="4713"/>
<outbound-socket-binding name="mail-smtp">
<!--
<local-destination socket-binding-ref="${xx:http}"/>
-->
<remote-destination host="${xx:localhost}" port="${xx:25}"/>
</outbound-socket-binding>
</socket-binding-group>
{code}
I'm not sure we care about transformation for 7.1.1? If we do a transformer is needed there
> support expressions for remote-destination-outbound-socket-binding host attrib
> ------------------------------------------------------------------------------
>
> Key: AS7-5321
> URL: https://issues.jboss.org/browse/AS7-5321
> Project: Application Server 7
> Issue Type: Sub-task
> Components: Domain Management
> Affects Versions: 7.1.1.Final
> Reporter: John Mazzitelli
> Assignee: Kabir Khan
> Labels: rhq
> Fix For: 7.2.0.Alpha1
>
>
> I appears that remote-destination-outbound-socket-binding resources cannot have attributes that are expressions - at least the host attrtibute. In JBossAS 4.2.3, we used to have a stock email service.xml that people could customize by simply passing in new system properties (rather than editing .xml or going through a CLI to change the values). However, in AS 7.1.1.Final, we can't do this for the mail service because at least the host attribute does not appear to allow for expressions:
> /socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=mail-smtp
> My host attribute was set to the expression ${rhq.server.email.smtp-host:localhost} and when I tried to start the server, I got:
> Caused by: java.net.UnknownHostException: ${rhq.server.email.smtp-host:localhost}
> at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method) [rt.jar:1.6.0_29]
> at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:849) [rt.jar:1.6.0_29]
> at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1202) [rt.jar:1.6.0_29]
> at java.net.InetAddress.getAllByName0(InetAddress.java:1153) [rt.jar:1.6.0_29]
> at java.net.InetAddress.getAllByName(InetAddress.java:1083) [rt.jar:1.6.0_29]
> at java.net.InetAddress.getAllByName(InetAddress.java:1019) [rt.jar:1.6.0_29]
> at java.net.InetAddress.getByName(InetAddress.java:969) [rt.jar:1.6.0_29]
> at org.jboss.as.network.OutboundSocketBinding.getDestinationAddress(OutboundSocketBinding.java:146)
> at org.jboss.as.mail.extension.MailSessionService.getServerSocketAddress(MailSessionService.java:106)
> The weird thing is, the port attribute appears to allow for expressions. When my port is set to this expression: "${rhq.server.email.smtp-port:25}", the server starts up fine (that is, after I set to the host to a legitimate hostname like "localhost")
> This JIRA is to request that expressions be supported for the host attribute as it appears to be supported for the port attribute.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list